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.

Lesson 23 of 69 · 14 min read · practice only with authorization

Diagram

Two parsers, two boundaries

Follow the path. One example at a time.

Step 1 of 4

Front end

A proxy reads a request using one length rule.

Illustration: Front end
# 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.

  1. 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.
  2. 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.
  3. 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                ^ reuse

If 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.

1 / 3

What causes request smuggling?

Sibling techniques

Pages at the same depth, plus a lab and a glossary card for this one.

  1. MapHow web applications work: requests, sessions, and where trust is decidedA browser request from DNS to database and back, the parts of an HTTP exchange a tester reads first, and the server-side decisions that most web vulnerabilities come down to.

Practice

  1. LabControl benchA failure is described. Choose the control that changes the outcome.