# Khaos HTTP Smuggling

> Methodology for detecting HTTP request smuggling (CL.TE, TE.CL, TE.TE) and HTTP desync attacks in authorized assessments

- Skill: `henriqqw/khaos-http-smuggling` (Agent Skill)
- Install (CLI): `npx get-skill add henriqqw/khaos-http-smuggling`
- Raw SKILL.md: https://api.skillmd.com/api/skills/henriqqw/khaos-http-smuggling/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: henriqqw (https://skillmd.com/u/henriqqw)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/henriqqw/khaos-http-smuggling

---


# HTTP Request Smuggling

## Objective

Identify HTTP desync vulnerabilities where a front-end proxy (CDN, load balancer, WAF) and back-end server disagree on where one HTTP request ends and the next begins, allowing an attacker to smuggle a prefix onto another user's request.

## Variants

| Variant | Front-end reads | Back-end reads |
|---|---|---|
| CL.TE | Content-Length | Transfer-Encoding |
| TE.CL | Transfer-Encoding | Content-Length |
| TE.TE | Both TE headers | Only one (obfuscated) |

## Detection with Smuggler

```
# Automated sweep — tests all three variants at 1 req/s
khaos_run_catalog_action("smuggler", assessment_id, endpoint)

# Output: "Possible vulnerability" lines per variant + timing delta
# Flag: delta > 2s on a CL.TE/TE.CL probe = likely desync
```

## Manual Verification: CL.TE

Send a request with a `Content-Length` header the front-end trusts and a `Transfer-Encoding: chunked` body the back-end reads.

```
POST / HTTP/1.1
Host: target
Content-Length: 6
Transfer-Encoding: chunked

0

X
```

The `X` is "smuggled" — if the next request to the back-end gets an unexpected `X` prefix, the front-end forwarded the full CL body but the back-end terminated at the `0\r\n\r\n` chunk end.

## Manual Verification: TE.CL

```
POST / HTTP/1.1
Host: target
Content-Length: 3
Transfer-Encoding: chunked

8
SMUGGLED
0


```

Front-end reads chunked (terminates at `0\r\n\r\n`), back-end reads CL=3 (terminates after `8\r\n`), leaving `SMUGGLED\r\n0\r\n\r\n` as a prefix on the next request.

## Timing Oracle (non-destructive probe)

```
# CL.TE timing: send 6 bytes CL, 0-chunk body, then wait
# If >5s response delay → back-end waiting for more chunked data → CL.TE present
khaos_http_request(assessment_id, {
  method: "POST", raw: true,
  body: "POST / HTTP/1.1\r\nHost: target\r\nContent-Length: 6\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nX"
})
```

## Impact Escalation Path

1. **Capture another user's request** — smuggle a partial POST to a handler that reflects the body (e.g. a search endpoint)
2. **Bypass front-end access controls** — smuggle a request to an internal-only path the front-end filters
3. **XSS via smuggled response** — desync response queue to inject script into a victim's response

## Validation Requirements

- **3 independent reproductions** with timing deltas recorded
- Each reproduction must show a consistent delay or body prefix on the follow-up request
- Use `khaos_http_request` for the follow-up probe (not automated tools) so timing is controlled
- Record raw HTTP exchange as evidence

## False Positive Mitigation

- Timing deltas under 1 second are noise; require ≥ 2s consistently across 3 runs
- `keep-alive` connections only — confirm `Connection: keep-alive` in both probes
- Re-test after switching User-Agent to rule out WAF-specific filtering
- If the endpoint uses HTTP/2, downgrade to HTTP/1.1 (smuggling is H1 only unless h2c is involved)

## Finding Classification

| Impact | OWASP | Severity |
|---|---|---|
| Request capture / account takeover | A01 | CRITICAL |
| Front-end bypass | A01/A05 | HIGH |
| Cache poisoning via smuggled response | A03 | HIGH |
| Timing oracle only (no escalation) | A05 | MEDIUM |

