# HTTP Request Smuggling
> Two HTTP components on the same connection disagree about where one request ends and the next begins, so an attacker's bytes are reinterpreted as the prefix of another user's request.
## What it is
Smuggling (a.k.a. HTTP desync) is a **parser differential on message framing**. A request chain — browser → CDN/WAF → reverse proxy / API gateway → origin — reuses a small pool of upstream connections to carry many users' requests. HTTP/1.1 delimits a body two ways: `Content-Length` (CL, a byte count) and `Transfer-Encoding: chunked` (TE, a `0\r\n\r\n` terminator). When the front-end and back-end derive the boundary differently, the back-end's view of the stream shifts: leftover bytes from the attacker's request are prepended to the victim's. The trust boundary that breaks is **request isolation** — HTTP/1.1 never isolated concurrent requests on a keep-alive socket; it assumed every hop agrees on byte framing ([[raw/portswigger.net/can-ai-do-novel-security-research-meet-the-http-terminator-11152|HTTP Terminator]], [[raw/apisec.ai/http-request-smuggling-in-api-gateways-3987|HTTP Request Smuggling in API Gateways]]). CWE-444 (Inconsistent Interpretation of HTTP Requests).
## Why it matters
Impact is near-worst-case and usually **cross-user, unauthenticated, and automatable**:
- **Response Queue Poisoning (RQP)** — the front-end loses track of which response belongs to which request, streaming other users' responses (session cookies, API keys, PII) to the attacker while DoSing everyone else ([[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync]]).
- **Prefix injection** — redirect victims' JS includes to an attacker origin → stored XSS / mass account takeover with no interaction (Netflix, [[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]]).
- **Control bypass** — smuggled requests skip gateway auth, rate limits, and path ACLs in a single step ([[API Gateway Security]], [[Header-Based Access Control Bypass]]).
- **Capturing other users' requests**, cache poisoning that persists the malicious response for everyone, and `Set-Cookie` injection to session-fixate the victim.
Max bounties are routine: $20k (Netflix), $15k×triple (Atlassian Jira), $6.5k first-timer on Slack ([[raw/medium.com/two-rulers-one-wire-how-an-http-desync-earned-a-first-time-hunter-6-50-14399|Two Rulers, One Wire]]).
## How it works
Every variant is one question: *which component wins the framing disagreement, and in which direction?*
- **[[CL.TE and TE.CL Desync]]** — classic HTTP/1.1. One hop honors `Content-Length`, the other `Transfer-Encoding`. Includes TE.TE (obfuscated TE that one parser rejects), CL.0 (back-end ignores the body entirely), and the early-response gadget that breaks the 0.CL deadlock.
- **[[HTTP2 Downgrade Smuggling|HTTP/2 Downgrade Smuggling]]** — a front-end speaks HTTP/2 (frame-length framing, unambiguous) but rewrites to HTTP/1.1 upstream. H2.CL / H2.TE arise when the downgrade trusts an attacker-supplied CL/TE; HTTP/2's binary headers also permit CRLF, colons, and spaces in places HTTP/1 forbids, enabling header/request-line injection.
- **[[Client-Side and Connection-Locked Desync]]** — CRLF-powered desync from header-injection primitives (request splitting), plus connection-locked / IP-locked / browser-powered desyncs that shift execution into the victim's browser when cross-connection poisoning is blocked, and the connection-reuse bugs behind them.
- **[[AI-Discovered Desync]]** — the HTTP Terminator's autonomous cascade: dual-matching CL, `multipart/byteranges` CL.0, the dangling-byte RQP technique, Response Forking, and Shared-Parser Confusion (a server reuses one parser for requests and responses).
Request **tunnelling** is the sibling primitive: when the front-end never reuses back-end connections, you can't hit other users, but you can still smuggle a request fully unprocessed by the front-end (bypassing path rules, leaking/forging internal headers). Confirm it with the HEAD technique, not the "send a flurry" test, which always false-negatives ([[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]]).
## Where to find it
- **Architecture smell:** any CDN / WAF / reverse proxy / API gateway in front of an origin, especially one that downgrades HTTP/2→HTTP/1.1 upstream or multiplexes many clients over shared back-end connections.
- **Servers/proxies with a history:** AWS ALB & API Gateway, Imperva Cloud WAF, Netlify, F5 BIG-IP, PulseSecure vTM, Netty/Zuul, HAProxy, Varnish, Apache Traffic Server, nginx (CRLF via `$uri` in `proxy_pass`), Hiawatha, Jetty, Envoy, Go net/http, Caddy, nghttpx, Citrix NetScaler.
- **Primitives that upgrade:** any reported "HTTP request header injection" / CRLF — it is badly underestimated and often a critical desync ([[raw/portswigger.net/making-http-header-injection-critical-with-one-prompt-13154|Making header injection critical with one prompt]]).
## How to test
1. **Baseline.** Pick a request with a stable response. Establish connection-reuse behavior (does your prefix reach your own later requests only, all users, or nobody?).
2. **Trigger detection by timeout.** Send a request whose framing makes the back-end wait for bytes that never arrive; a hang confirms a parsing disagreement. This is how HTTP Request Smuggler and Burp Scanner detect CL.TE/TE.CL/H2.x.
3. **Differential probing.** For HTTP/2, see HTTP/1 headers inside the H/2 response body = desync. For tunnelling, use HEAD and look for a leaked `Content-Length` of the smuggled response.
4. **Confirm safely** with a self-targeting prefix before any cross-user payload — smuggling exactly **two** complete requests gives triagers undeniable evidence without harming users.
5. **Scope the direction** (CL.TE vs TE.CL vs CL.0 vs H2.x) and the isolation model before weaponizing.
Checklist:
- [ ] Map the proxy chain and whether HTTP/2 is downgraded upstream.
- [ ] Timeout-test CL.TE, TE.CL, TE.TE, CL.0, H2.CL, H2.TE.
- [ ] Test obfuscated TE (`xchunked`, tab/space, line-folding, duplicate headers).
- [ ] Probe header smuggling via mutated header names (space-suffix, underscores, invalid bytes).
- [ ] Determine connection reuse (cross-user vs connection-locked vs IP-locked vs tunnelling-only).
- [ ] If header injection / CRLF is reported, escalate to request splitting → RQP.
- [ ] Test method/path handling: methods allowed a body, `GET /admin` request-line injection.
## Exploitation and escalation
- **RQP** → harvest other users' responses (cookies, tokens). See [[CL.TE and TE.CL Desync]], [[Client-Side and Connection-Locked Desync]].
- **Prefix / resource redirect** → malicious JS → ATO, often via the HEAD gadget to force a cached XSS. Links [[Account Takeover]], [[DOM-Based XSS]].
- **Capture victim requests** into a stored/reflected gadget (profile field) to steal credentials in bulk.
- **Cache poisoning** → persist the malicious response to every visitor ([[Web Cache Poisoning]]).
- **Bypass front-end authz** and reach internal endpoints / IDOR ([[raw/hipotermia.pw/http-request-smuggling-idor-hipotermia-409|HTTP Smuggling + IDOR]], [[BOLA in APIs]], [[Header-Based Access Control Bypass]]).
- **Internal header forging** via tunnelling — smuggle `X-Forwarded-For`, auth/identity headers past the front-end's rewrite; discover their names with Param Miner.
## Bypassing defenses
- **TE obfuscation** (`Transfer-Encoding: xchunked`, trailing tab/space, line-folding, header duplication) defeats front-ends that pattern-match TE instead of parsing it.
- **`\n`-only vs `\r\n`** — blocking `\r\n` but not a bare `\n` is a classic failed hotfix; `\n` alone usually suffices.
- **HTTP/2 charset smuggling** — inject CRLF, colons-in-names, or spaces-in-method through binary H/2 that re-imposed HTTP/1 limits fail to reject.
- **Header-name mutation** slips `Content-Length`/`X-Forwarded-For` past one parser in the chain ([[raw/intruder.io/practical-http-header-smuggling-sneaking-past-reverse-proxies-to-attac-6537|Practical HTTP Header Smuggling]]).
- **WAF `%0d%0a` filters** are beaten with Unicode normalization / encoding tricks on the injection point ([[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync]]).
## Real-world cases
- **Netflix / Netty (CVE-2021-21295)** — H2.CL, JS hijack, $20k ([[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]]).
- **AWS ALB / Verizon / AOL** — H2.TE, OAuth code & bearer-token theft; **Atlassian Jira** (PulseSecure vTM) — RQP leaking sessions, global session expiry, $15k×3; **Netlify CDN / F5 BIG-IP / Imperva** affected (same source).
- **Slack `slackb.com`** — CL.TE, session-cookie theft, Evan Custodio, $6.5k ([[raw/medium.com/two-rulers-one-wire-how-an-http-desync-earned-a-first-time-hunter-6-50-14399|Two Rulers, One Wire]]).
- **Hiawatha ≤12.1 (CVE, CWE-444)** — prioritizes CL over TE and forwards both; fixed in 12.2 ([[raw/fenrisk.com/http-request-smuggling-in-hiawatha-10911|HTTP Request Smuggling in Hiawatha]]).
- **Varnish (CVE-2021-36740)** — H2 request smuggling via H/2→H/1 rewrite ([[raw/labs.detectify.com/how-to-set-up-docker-for-varnish-http-2-request-smuggling-6629|Varnish H2 smuggling]]).
- **HAProxy** — CVE-2023-40225 (empty CL) and CVE-2024-53008 (CL/TE ACL bypass); **Apache mod_proxy** request-line injection (CVE-2021-33193) ([[raw/apisec.ai/http-request-smuggling-in-api-gateways-3987|API Gateways]], [[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]]).
- **Apache Traffic Server (CVE-2026-63078)** and dual-CL bugs on Meta/bank/SSO/Citrix NetScaler infra, found autonomously ([[raw/portswigger.net/can-ai-do-novel-security-research-meet-the-http-terminator-11152|HTTP Terminator]]).
- **IDOR chain** — CL.TE smuggles `GET /admin…` to the back-end as the next user's request ([[raw/hipotermia.pw/http-request-smuggling-idor-hipotermia-409|HTTP Smuggling + IDOR]]); first-bug CL.TE writeup ([[raw/link.medium.com/finding-my-first-bug-http-request-smuggling-1030|Finding My First Bug]]).
## Prevention
- **Use HTTP/2 (or higher) end-to-end. Never downgrade to upstream HTTP/1.1** — this is the root-cause fix ([[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]], [[raw/portswigger.net/can-ai-do-novel-security-research-meet-the-http-terminator-11152|HTTP Terminator]]).
- **Reject ambiguous framing:** any request with both CL and TE, duplicate/empty CL, obfuscated TE, or (downgrading) CRLF/colon-in-name/space-in-method. Normalize before forwarding.
- **Allow-list request methods** on both front-end and back-end, and separately allow-list which methods may carry a body (effectively POST/PUT/PATCH only) — the two extra Terminator recommendations.
- **nginx:** avoid `$uri`/`$document_uri` in `proxy_pass`/`return` to kill CRLF injection into the upstream request.
- **Disable back-end connection reuse** where HTTP/1.1 upstream is unavoidable; it blocks cross-user contamination at a performance cost.
- Patch proxies/servers to current versions; verify header-normalization rules survive every config and library change.
## Tools
- **HTTP Request Smuggler** (Burp) — detection + exploit for CL.TE/TE.CL/TE.TE/H2.x/CL.0, HEAD tunnelling, request-contamination checks. [[Burp Suite Extensions]].
- **Turbo Intruder** — the `BURP`/`HTTP2` engines for desync, RQP and single-packet timing; now with an MCP interface ([[Turbo Intruder]]).
- **Param Miner** — guesses internal/secret header names, protocol-ruler analysis.
- **Burp Scanner / Burp AT** — automated desync + CRLF-desync skills ([[Burp AI and MCP]]).
- **HTTP Terminator** — PortSwigger's open-source autonomous desync research factory.
- **Hackvertor** — encoding for CRLF injection points. **Burp Collaborator** for blind OAST ([[Burp Collaborator]]).
## Sub-pages
- [[CL.TE and TE.CL Desync]] — classic HTTP/1.1 framing disagreements, TE.TE, CL.0 and the early-response gadget.
- [[HTTP2 Downgrade Smuggling|HTTP/2 Downgrade Smuggling]] — H2.CL / H2.TE from HTTP/2→HTTP/1.1 downgrade and binary-header injection.
- [[Client-Side and Connection-Locked Desync]] — CRLF-powered / request-splitting desync, browser-powered, connection-locked, IP-locked, and connection-reuse bugs.
- [[AI-Discovered Desync]] — the HTTP Terminator cascade: dual-CL, multipart/byteranges, dangling-byte RQP, Response Forking, Shared-Parser Confusion.
## Related
- [[API Gateway Security]] · [[Header-Based Access Control Bypass]] · [[Web Cache Poisoning]] · [[Web Exploitation Talks]] · [[Vulnerability Chaining]] · [[Account Takeover]] · [[Session Management]] · [[BOLA in APIs]] · [[DOM-Based XSS]]
## Sources
- [[raw/portswigger.net/can-ai-do-novel-security-research-meet-the-http-terminator-11152|Can AI do novel security research? Meet the HTTP Terminator]]
- [[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync Attacks: Beheading HTTP Streams]]
- [[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel is Always Worse]]
- [[raw/apisec.ai/http-request-smuggling-in-api-gateways-3987|HTTP Request Smuggling in API Gateways]]
- [[raw/portswigger.net/advanced-request-smuggling-5092|Advanced request smuggling]]
- [[raw/xclow3n.com/connection-reuse-leading-to-desync-12393|Smuggling Shouldn't Exist Anymore, Right? (connection reuse)]]
- [[raw/intruder.io/practical-http-header-smuggling-sneaking-past-reverse-proxies-to-attac-6537|Practical HTTP Header Smuggling]]
- [[raw/fenrisk.com/http-request-smuggling-in-hiawatha-10911|HTTP Request Smuggling in Hiawatha]]
- [[raw/hipotermia.pw/http-request-smuggling-idor-hipotermia-409|HTTP Request Smuggling IDOR]]
- [[raw/link.medium.com/finding-my-first-bug-http-request-smuggling-1030|Finding My First Bug: HTTP Request Smuggling]]
- [[raw/medium.com/two-rulers-one-wire-how-an-http-desync-earned-a-first-time-hunter-6-50-14399|Two Rulers, One Wire: HTTP Desync on Slack]]
- [[raw/labs.detectify.com/how-to-set-up-docker-for-varnish-http-2-request-smuggling-6629|Varnish HTTP/2 request smuggling]]
- [[raw/portswigger.net/making-http-header-injection-critical-with-one-prompt-13154|Making HTTP header injection critical with one prompt]]
- [[raw/infosecwriteups.com/the-most-overlooked-vulnerability-http-request-smuggling-10910|The Most Overlooked Vulnerability — HTTP Request Smuggling]]
- [[raw/rafa.hashnode.dev/research-exploiting-http-parsers-inconsistencies-990|Exploiting HTTP Parsers Inconsistencies]]
- [[raw/theinjection.dev/http-terminator-an-ai-system-proposed-a-new-desync-attack-class-def-co-14384|HTTP Terminator: an AI system proposed a new desync attack class]]
- [[raw/yeswehack.com/james-kettle-s-autonomous-research-cascade-crlf-powered-desync-attacks-12027|James Kettle's Autonomous Research Cascade]]