HTTP request smuggling and desync: when two servers disagree where a request ends
How front-end and back-end servers can parse Content-Length and Transfer-Encoding differently, letting one request carry the start of another; response queue poisoning and HTTP/2 downgrades; and the configuration that prevents desync.
Diagram
Two parsers, two boundaries
Step 1 of 4
Front end
A proxy reads a request using one length rule.
# Front end # A proxy reads a request using one length rule.
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
CL versus TE
- What fails
- When both length headers are present, RFC 9112 says Transfer-Encoding wins and the message should be treated carefully; implementations have disagreed.
- Who is affected
- All users sharing back-end connections.
- What you would notice
- A front end that forwards requests with both headers.
- What you change
- Reject or normalize such requests at the first hop.
HTTP/2 downgrade
- What fails
- Front ends that speak HTTP/2 to clients and HTTP/1.1 to back ends must rewrite length information correctly.
- Who is affected
- Users behind CDNs and load balancers that downgrade.
- What you would notice
- Header values with CRLF or conflicting lengths accepted over HTTP/2.
- What you change
- Use HTTP/2 to the back end or a proxy version with strict rewriting.
Response desync
- What fails
- If responses get out of order, users can receive each other’s responses, including session cookies.
- Who is affected
- Any user of the affected connection pool.
- What you would notice
- Users reporting they saw another account’s page.
- What you change
- Treat such reports as incidents and disable connection reuse while investigating.
Detecting it safely
Desync testing can affect other users on shared infrastructure, so it belongs in a staging chain that mirrors production or in a window agreed with the owner. Timing-based detection, where a crafted request causes a delay only if the servers disagree, is less disruptive than attempts to affect other requests. Burp Suite’s HTTP Request Smuggler extension automates detection within scope.
Inventory the chain
Write down every hop between client and application: CDN, WAF, load balancer, ingress, application server. Record the HTTP versions between each and whether connections are reused. That diagram tells you where to look and which vendor advisories apply.
client --h2--> CDN --h1.1 keep-alive--> ALB --h1.1--> nginx ingress --h1.1--> gunicorn
^ downgrade ^ reuse ^ reuseIf it is found
Disable back-end connection reuse or switch to HTTP/2 end to end as a quick mitigation, patch the disagreeing component, and review logs for users who received unexpected responses.
Check yourself
Recognition and the fix. Nothing here is a procedure.
What causes request smuggling?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.