π Introduction
In today's modern web architecture, applications often rely on multiple layers such as load balancers, reverse proxies, and backend servers. While this layered approach improves performance and scalability, it can introduce subtle security flaws.
One such high-impact vulnerability is HTTP Request Smuggling β a technique that exploits inconsistencies in how different servers interpret HTTP requests.
βοΈ What is HTTP Request Smuggling?
HTTP Request Smuggling occurs when an attacker sends a specially crafted HTTP request that is interpreted differently by a front-end server (e.g., proxy) and a back-end server.
This mismatch allows attackers to "smuggle" malicious requests inside normal ones, bypassing security controls.
How It Works ?
At the core of this vulnerability lies ambiguity in handling two HTTP headers:
Content-LengthTransfer-Encoding
π Key Concept:
- Front-end server processes request one way
- Back-end server processes it differently
This leads to desynchronization in request parsing.
π Types of HTTP Request Smuggling
1. CL.TE (Content-Length + Transfer-Encoding)
- Front-end uses
Content-Length - Back-end uses
Transfer-Encoding
2. TE.CL (Transfer-Encoding + Content-Length)
- Front-end uses
Transfer-Encoding - Back-end uses
Content-Length
3. TE.TE
- Both use
Transfer-Encodingbut interpret differently
π§ͺ Example Attack Scenario
POST / HTTP/1.1 Host: vulnerable.com Content-Length: 13 Transfer-Encoding: chunked
0
GET /admin HTTP/1.1 Host: vulnerable.com
π In this case:
- Front-end may treat request as complete after
0 - Back-end processes the smuggled
GET /adminrequest
π¨ Impact of HTTP Smuggling
This vulnerability can lead to serious consequences:
- π Authentication bypass
- πͺ Session hijacking
- π Cache poisoning
- π‘ Data exfiltration
- πͺ Access to restricted endpoints
- π Request queue poisoning
π§° Prevention & Mitigation
β Best Practices:
Use consistent parsing rules
- Ensure front-end and back-end servers interpret requests identicall
Disable ambiguous headers
- Reject requests containing both
Content-LengthandTransfer-Encoding
Normalize requests
- Use a single standard for request handling
Keep servers updated
- Patch known vulnerabilities
Use Web Application Firewalls (WAFs)
- Detect malformed HTTP requests
Strict RFC compliance