Apache Camel security advisory: CVE-2026-59230
Severity
MEDIUMSummary
Camel-Mail: the MimeMultipart data format copied MIME headers onto the Camel message without a header filter strategy when unmarshalling with headersInline enabled, so a crafted message could inject Camel-internal headersVersions affected
From 2.17.0 before 4.14.9, from 4.15.0 before 4.18.4, from 4.19.0 before 4.22.0.Versions fixed
4.14.9, 4.18.4 and 4.22.0Description
The camel-mail component ships a MimeMultipart data format that can unmarshal a MIME multipart message. When it is configured with headersInline set to true, the unmarshal path copies the MIME headers of the incoming message onto the Camel message: it enumerates every header that is not one of the three standard ones it generates itself - Message-ID, MIME-Version and Content-Type - and calls setHeader for each, applying no HeaderFilterStrategy. The names of those MIME headers come from the message being unmarshalled, so a sender able to influence the message could place a header whose name falls in the Camel-internal namespace and have it set on the Exchange. Camel components read control headers from that namespace to override their configured behaviour - the camel-sql producer, for instance, takes the statement to execute from a Camel header when one is present - so an injected header could redirect what a downstream step in the route does with data the route author never intended it to take from the message. Which sinks are reachable, and what the consequences are, depends entirely on what the route does after the unmarshal step. The camel-mail consumer already applied a header filter strategy on its own inbound path, so this was the parallel inbound path into the same component that the earlier hardening did not cover. The affected copy is reached only when headersInline is enabled, which is not the default: with the default setting the MIME headers are surfaced as attachments rather than as message headers, and are not affected. The behaviour dates back to the introduction of the data format in 2.17.0 and was present on every release line until this fix.Notes
The JIRA ticket: https://issues.apache.org/jira/browse/CAMEL-23891 refers to the various commits that resolved the issue, and has more details.
The fix was merged on main in https://github.com/apache/camel/pull/24406 (commit ca74898bdef4f2917755ed8911eedfc7f09bd589) and backported to camel-4.14.x in https://github.com/apache/camel/pull/24445 (commit ccdeebc2ae378ba75e5563ddab508fc887527f0c). On camel-4.18.x it landed in two parts: https://github.com/apache/camel/pull/24409 (commit 4d03138dc27c04afdaae6cd40f026c23ed8d7973) followed by https://github.com/apache/camel/pull/24454 (commit cd1333ca1c1d491b4d121878dc025b130554d367), and both are contained in the 4.18.4 release. A follow-up documentation change, https://github.com/apache/camel/pull/24456 (commit ca1af9cff50b67df1f31c52f682da11ee025a36b), synchronised the upgrade-guide notes for the maintenance branches onto main.
The fix routes the header copy through a HeaderFilterStrategy, so headers in the Camel-internal namespace are matched case-insensitively and skipped rather than set on the message, bringing the data format into line with what the camel-mail consumer already did. The strategy is obtained differently per branch: on main the component relies on the DefaultHeaderFilterStrategy default that already filters Camel-prefixed headers inbound, whereas on camel-4.18.x and camel-4.14.x that default is not present and the in-filter is configured explicitly - which is why the 4.18.x fix required the second commit above. The change is limited to the header copy on the unmarshal path; the marshal direction and the attachment handling are unchanged, and ordinary MIME headers continue to be propagated. Because a route that legitimately relied on receiving a Camel-named MIME header will no longer see it, the change is noted in the upgrade guides as a potential breaking change. The issue is classified as CWE-20 (Improper Input Validation) and is a header-injection issue of the same class as the Camel consumer advisories published previously, where an inbound path maps sender-controlled names into the Exchange header map without a strict, case-insensitive HeaderFilterStrategy.
Mitigation
Users are recommended to upgrade to version 4.22.0, which fixes the issue. If users are on the 4.14.x LTS releases stream, then they are suggested to upgrade to 4.14.9. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.4. For deployments that cannot upgrade immediately, leave headersInline at its default of false where the inline headers are not needed, since the copy is only reached when it is enabled. Where it must stay enabled, strip Camel-internal headers immediately after the unmarshal step, for example with removeHeaders(“Camel*”) placed before any processor or producer that reads control headers, and do not unmarshal MIME content from an untrusted sender into a route that dispatches on header values. As defence in depth, treat the header names of any MIME message arriving from outside the trust boundary as untrusted input.Credit
This issue was discovered by Atuin - Automated Vulnerability Discovery Engine, anciety of Tencent Xuanwu LabReferences
- PGP signed advisory data: CVE-2026-59230.txt.asc
- Mitre CVE Entry: https://www.cve.org/CVERecord?id=CVE-2026-59230