Apache Camel camel-mail Header Injection to RCE - CVE-2026-33454
Published: 2026-11-27 • Researcher: Andrea Cosentino (oscerd), repo author; vulnerability reported by Hyunwoo Kim (@v4bel)
- Severity
- Critical
- CVE
- CVE-2026-33454 / CAMEL-23222
- Category
- network
- Affected product
- Apache Camel, camel-mail component (MailHeaderFilterStrategy and MailBinding)
- Affected versions
- 3.0.0 to before 4.14.6, and 4.15.0 to before 4.18.1 (fixed in 4.14.6, 4.18.1, and 4.19.0)
- Disclosed
- 2026-11-27
- Patch status
- Patched
Tags
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-07-06 |
| Author / Researcher | Andrea Cosentino (oscerd), repo author; vulnerability reported by Hyunwoo Kim (@v4bel) |
| CVE / Advisory | CVE-2026-33454 / CAMEL-23222 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.4 (CVSSv3.1, per NVD record) |
| Status | Weaponized |
| Tags | Apache Camel, camel-mail, header injection, MIME headers, IMAP, camel-exec, RCE, CWE-1173, CWE-502, Java, Spring Boot |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Apache Camel, camel-mail component (MailHeaderFilterStrategy and MailBinding) |
| Versions Affected | 3.0.0 to before 4.14.6, and 4.15.0 to before 4.18.1 (fixed in 4.14.6, 4.18.1, and 4.19.0) |
| Language / Platform | Java 17+, Spring Boot 3.2.0, Camel 4.18.0 in the bundled reproducer, GreenMail 2.1.0 mail server |
| Authentication Required | No to the affected application; the attacker needs the ability to send email to the monitored mailbox |
| Network Access Required | Yes (SMTP to the mailbox, and the application polls IMAP/POP3) |
Summary
Apache Camel’s mail component maps inbound MIME headers into the Camel message, and the filter meant to strip Camel control headers was configured for the outbound direction only. An attacker who can send an email to a monitored mailbox can therefore set headers such as CamelExecCommandExecutable and CamelExecCommandArgs, which are honoured by the exec producer downstream. This repository is a runnable reproducer: GreenMail provides the mailbox, a Spring Boot application consumes it over IMAP and invokes a fixed harmless command, and a controller plays the attacker by delivering the malicious mail. The result is arbitrary command execution on the machine hosting the application.
Vulnerability Details
Root Cause
MailHeaderFilterStrategy extends DefaultHeaderFilterStrategy, and in affected versions its constructor calls setOutFilterStartsWith for the Camel prefix but never calls setInFilterStartsWith. When MailBinding.extractHeadersFromMail enumerates the MIME headers of a consumed message, each header is tested with applyFilterToExternalHeaders, whose inbound path consults the in filter. Because that filter was never configured, nothing matches, the check is skipped, and every Camel-prefixed MIME header is copied into the Exchange In headers alongside ordinary mail metadata. Downstream components resolve their own control headers from the Exchange, so a header supplied by the email sender takes over behaviour the route author never intended to expose.
Attack Vector
Deliver an email to the mailbox monitored by a Camel route such as from imap://host:3143, with MIME headers named CamelExecCommandExecutable and CamelExecCommandArgs. The bundled ExploitController does this over SMTP through jakarta.mail, but any mail client or raw SMTP session works. The route must forward to a header-sensitive producer, or otherwise resolve producer configuration from headers, without stripping Camel headers in between.
Impact
Arbitrary OS command execution as the user running the Camel application when the route reaches camel-exec. The advisory and the upstream notes extend the same primitive to camel-file for arbitrary file writes and path traversal through CamelFileName, to camel-bean for method selection through CamelBeanMethodName, and to camel-sql through query control headers. Because the trigger is an ordinary email, the attacker needs no network position against the application itself, only an address that a mail route reads.
Environment / Lab Setup
OS: Linux, macOS, or Windows with Docker and a JDK
Target: The bundled Spring Boot application with Camel 4.18.0 and a route consuming IMAP
Attacker: The bundled /exploit controller, or any SMTP client able to add custom MIME headers
Tools: Java 17+, Maven 3.8+, Docker, curl, jakarta.mailSetup Steps
| |
The victim route uses imap://127.0.0.1:3143 with username victim and password secret, delete=true and unseen=true, and forwards to exec:echo?args=hello.
Proof of Concept
Step-by-Step Reproduction
Start the lab - Bring up GreenMail and the application as described above, then confirm the consumer is polling without errors.
Send a benign message - Establish the baseline where the route runs its configured command.
Shell script1curl http://localhost:8080/exploit/normalSend the malicious message - The email carries exec override headers; the default payload touches a file to prove execution.
Shell script1curl "http://localhost:8080/exploit/attack?exe=/usr/bin/touch&args=/tmp/pwned"Confirm the sink fired - Wait a couple of seconds for the IMAP poll cycle and check for the file.
Shell script1sleep 3; ls -l /tmp/pwnedTry another command - Any executable and argument string can be supplied the same way, for example an id redirect through a shell.
Shell script1curl "http://localhost:8080/exploit/attack?exe=/bin/sh&args=-c%20id%20%3E%20/tmp/camel-id"
Exploit Code
See
src/main/java/com/example/ExploitController.java(attacker side) andsrc/main/java/com/example/MailExecRoute.java(victim route) in this folder.
| |
Expected Output
$ curl "http://localhost:8080/exploit/attack?exe=/usr/bin/touch&args=/tmp/pwned"
Sent a malicious email to victim@localhost with injected MIME headers:
CamelExecCommandExecutable: /usr/bin/touch
CamelExecCommandArgs: /tmp/pwned
$ sleep 3; ls -l /tmp/pwned
-rw-r--r-- 1 user user 0 <date> /tmp/pwnedThe route log also shows the exec producer output in place of the expected echo hello, which confirms the header override took effect.
Detection & Indicators of Compromise
CamelExecCommandExecutable:
CamelExecCommandArgs:
CamelFileName:
CamelBeanMethodName:SIEM / IDS Rule (example):
alert smtp any any -> any any (msg:"Camel header injection delivery (CVE-2026-33454)"; content:"CamelExecCommand"; nocase; sid:9003345;)Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to Camel 4.14.6, 4.18.1, or 4.19.0, where MailHeaderFilterStrategy configures the in filter with the Camel prefix plus the mail.smtp and mail.smtps prefixes. |
| Workaround | Add removeHeaders(“Camel*”) immediately after the mail consumer, or avoid header-sensitive producers such as camel-exec, camel-file, camel-bean, and camel-sql downstream of untrusted mail. |
| Config Hardening | Restrict who can deliver to monitored mailboxes with SPF, DKIM, and allowlists; remove the exec component entirely where it is not required; log and alert on Camel-prefixed headers in delivered mail. |
References
Notes
Auto-prepared on 2026-11-27 from https://github.com/oscerd/CVE-2026-33454 (stars 1, Java reproducer maintained by an Apache Camel committer).
Review verdict: ingested. The repository is a complete, runnable reproducer rather than a scan or a write-up: the route genuinely consumes IMAP and forwards to exec, the controller genuinely delivers mail with Camel control headers, and the README documents verification by observing the created file. No malicious capability beyond a harmless touch is shipped; it is a lab reproducer, so it is marked Weaponized because the exploit path is fully implemented end to end.
License: the upstream repository has no LICENSE file and no explicit license statement; copyright remains with the author. Attribution and the source URL are retained. Docker Compose and the Maven metadata were copied because they are required to reproduce the lab.
Limitations: the reproducer is fixed to localhost SMTP and IMAP ports and to the victim account, so adapting it to a real target means changing the send host and port in ExploitController and the broker URI in MailExecRoute. Success depends on the route reaching a header-sensitive producer with no header stripping, which many production routes already avoid. The bundled application is not itself a mail server attack: it simulates the attacker as a convenience controller, and any external SMTP client can send the same two headers. No exploit code was executed while preparing this entry.