HTTP Request Smuggling¶
← Back to index · Stage 1 (capture a session) / Stage 2 (reach /admin) · Read the mindset page first.
Why it exists: a front-end server and a back-end server share one TCP connection but may use different rules to decide where a request ends. If you can make them disagree, the bytes you send get split so that part of your request is treated by the back-end as the start of the next person's request — letting you prefix the victim's traffic (steal their session) or reach paths the front-end would block. It's the fiddliest class on BSCP; lean on the HTTP Request Smuggler extension, because hand-counting bytes is how this goes wrong.
The one rule: find a front-end/back-end parsing disagreement (CL vs TE, or an HTTP/2 downgrade) → confirm it with a differential response (not just timing) → weaponize by smuggling a prefix onto the next request.
Decision tree¶
flowchart TD
A["Protocol to the front-end?"] --> H1["HTTP/1.1"]
A --> H2["HTTP/2"]
H1 --> DET["Smuggler probe / timing test"]
DET --> CLTE["CL.TE"]
DET --> TECL["TE.CL"]
H2 --> DG["Front-end downgrades to 1.1?"]
DG -->|yes| DESYNC["H2.CL or H2.TE"]
DG -->|rewrites headers| CRLF["H2 CRLF injection"]
CLTE --> CONF["Confirm with a differential"]
TECL --> CONF
DESYNC --> CONF
CRLF --> CONF
CONF --> G{"Goal?"}
G -->|reach admin| BYP["Prefix a restricted path"]
G -->|take a session| CAP["Capture the next user's request"]
Reading the response: two signals, and timing alone is weak. The first tell is a hang/delay on a crafted request (the back-end waiting for bytes that never arrive). But confirm with a differential: send the smuggled prefix, then a normal request, and read whether request #2 gets an anomalous response — a
404/400or admin content where a plain request returns200. Intermittent results are normal; the differential, not the vibe, is your proof.
1. The mechanism — why they disagree¶
Two headers can declare a body's length:
- Content-Length (CL): "the body is N bytes."
- Transfer-Encoding: chunked (TE): "the body ends at a 0-size chunk."
Send both, and obfuscate one so only one server honours it. Now they disagree on where your request ends — and the leftover bytes become a prefix on the next request. CL.TE = front uses CL, back uses TE; TE.CL = the reverse.
2. Detect — why timing works¶
Why: craft a request where the back-end is left waiting for bytes that never arrive — the connection hangs, which is a reliable desync tell. Let the extension do the exact byte math:
right-click -> HTTP Request Smuggler -> Smuggle probe (tests CL.TE / TE.CL / H2 and reports confirmed vectors)
Disable Repeater's "Update Content-Length" and send over HTTP/1.1 for manual tests, or Burp rewrites your carefully-crafted lengths and nothing works.
3. CL.TE / TE.CL¶
# CL.TE (front=CL reads 6 bytes and forwards all; back=TE sees the 0-chunk end, leaving 'G' to prefix the next request)
POST / HTTP/1.1
Host: TARGET
Content-Length: 6
Transfer-Encoding: chunked
0
G
# TE obfuscation — hide TE from one parser so it falls back to CL
Transfer-Encoding: xchunked
Transfer-Encoding:[tab]chunked
4. HTTP/2 desync¶
Why: if the front-end speaks HTTP/2 to you but downgrades to 1.1 behind it, HTTP/2's built-in length is lost on the way down, and you can smuggle via a CL/TE the downgraded back-end obeys — or inject \r\n inside an HTTP/2 header value (impossible in 1.1) to split a request. Smuggler's H2 probes find these; don't force 1.1 on an H2 target — the downgrade is the bug.
5. Weaponize¶
- Reach
/admin(Stage 2): smuggle a prefix requesting/adminso the back-end serves it as if it passed the front-end's access control. - Capture a session (Stage 1): smuggle a prefix that appends the victim's next request — including their session cookie — into a field you can read back (a comment body, your own account page). This is a non-interactive foothold, which the mindset page says to prefer.
Failure modes — and why¶
- Nothing happens first try → send the attack request, then immediately a normal request on the same connection; the prefix lands on request #2, not yours.
- Results are intermittent → normal for smuggling (the connection may be reset or load-balanced elsewhere); retry, and confirm with a differential (a 404 vs 200 on the smuggled path), not vibes.
- Content-Length keeps changing → Repeater's auto-update is on; disable it, send raw over 1.1.
- Lengths off by one → CRLF is two bytes; let the extension compute chunk sizes rather than counting by hand.