Executive brief
Apache Camel's mail component processes incoming email messages and converts them into data that integration routes can work with. When configured to expose email headers as message headers (headersInline mode), the component fails to filter Camel's internal control headers, allowing an attacker to craft a malicious email with specially-named headers that override route behavior—for example, redirecting SQL commands or changing message destinations. This could lead to data exposure, unauthorized database operations, or message routing to wrong endpoints depending on downstream components.
Technical details
The vulnerability is an improper input validation flaw (CWE-20) in the camel-mail component's MimeMultipart data format. When headersInline is set to true during unmarshal operations, the code copies all MIME headers from the incoming message onto the Camel Exchange without applying a HeaderFilterStrategy. An attacker who can influence inbound email messages can inject headers with names in the Camel-internal namespace (e.g., "Camel-*" prefix) which are read as control directives by downstream Camel producers (e.g., camel-sql reads statement overrides from headers). The attack requires network-reachable mail input and headersInline to be explicitly enabled (non-default). Exploitation impact depends entirely on the route's downstream components: potential consequences include data exfiltration, SQL injection redirection, or cross-topic message writes. Patches are available in versions 4.14.9, 4.18.4, and 4.22.0. Workarounds include keeping headersInline at its default false value or explicitly stripping Camel-prefixed headers immediately post-unmarshal.
Affected products
- Apache Camel 2.17.0 to 4.14.8, 4.15.0 to 4.18.3, 4.19.0 to 4.21.x
- Apache Camel-Mail 2.17.0 to 4.14.8, 4.15.0 to 4.18.3, 4.19.0 to 4.21.x
Timeline
- 2026-08-24: disclosed: Vulnerability published to GitHub Advisory Database
- 2026-08-24: patched: Patches released: 4.14.9, 4.18.4, 4.22.0