This weakness occurs when a proxy, firewall, or other intermediary HTTP agent interprets a malformed HTTP request or response differently than the final destination server or client. This inconsistency allows an attacker to craft messages that bypass the intermediary's security checks.
HTTP request smuggling exploits differences in how web servers, clients, and intermediary devices (like load balancers, reverse proxies, or WAFs) parse ambiguous HTTP messages. An attacker can inject conflicting headers—such as duplicate `Content-Length` or `Transfer-Encoding` fields—causing the intermediary and the backend server to see two different requests or responses in the same network stream. This lets malicious traffic slip through undetected. This vulnerability typically stems from using outdated HTTP parsing libraries or mismatched protocol versions between system components. To prevent it, developers must ensure all HTTP agents in the data flow use consistent, up-to-date parsing logic and rigorously validate message formatting.
Impact: Unexpected StateHide ActivitiesBypass Protection Mechanism
An attacker could create HTTP messages to exploit a number of weaknesses including 1) the message can trick the web server to associate a URL with another URL's webpage and caching the contents of the webpage (web cache poisoning attack), 2) the message can be structured to bypass the firewall protection mechanisms and gain unauthorized access to a web application, and 3) the message can invoke a script or a page that returns client credentials (similar to a Cross Site Scripting attack).
POST http://www.website.com/foobar.html HTTP/1.1 Host: www.website.com Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded Content-Length: 0 Content-Length: 54
GET /poison.html HTTP/1.1 Host: www.website.com Bla: GET http://www.website.com/page_to_poison.html HTTP/1.1 Host: www.website.com Connection: Keep-Alive
GET /poison.html HTTP/1.1 Host: www.website.com Bla:
GET http://www.website.com/page_to_poison.html HTTP/1.1 Host: www.website.com Connection: Keep-Alive
POST http://www.website.com/foobar.html HTTP/1.1 Host: www.website.com Connection: Keep-Alive Content-Type: application/x-www-form-urlencoded Content-Length: 0
Content-Length: 54 (ignored by server)
GET /poison.html HTTP/1.1 Host: www.website.com Bla: GET http://www.website.com/page_to_poison.html HTTP/1.1 Host: www.website.com Connection: Keep-Alive
java
// Set up response writer object* ... try { ```
java
// output error response* } else { ```
javabashHTTP/1.1 200 OK Date: Fri, 08 Aug 2016 08:12:31 GMT Server: Apache (Unix) Connection: Keep-Alive Content-Encoding: gzip Content-Type: text/html
Content-Length : 2345 Transfer-Encoding: chunked
Set-Cookie : token="Malicious Code"
... "Malicious Code"