Skip to content
Smuggling / CRLF Write-up Advanced

Making desync attacks easy with TRACE

An HTTP/2 desync vulnerability allowed header injection, and the TRACE method was used to reflect a malicious script in a response. By combining this with response smuggling and web cache poisoning, an attacker could store and serve the script to other users.

Martin Doyhenard Follow

Published on portswigger.net

Have you ever found an HTTP desync vulnerability that seemed impossible to exploit due to its complicated constraints? In this blogpost we will explore a new exploitation technique that can be used to completely compromise a web application using TRACE - an ancient HTTP method that's more widely supported than you…

Martin Doyhenard (@tincho_508), on portswigger.net

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the front-end proxy and back-end server disagreed on request boundaries due to HTTP/2 header injection, and the back-end supported TRACE, allowing response splitting and cache poisoning.

Impact

An attacker could poison the cache to serve malicious JavaScript to other users, potentially leading to account compromise or other attacks, though the exploit required specific conditions such as TRACE being enabled and cacheable responses.

What the attacker needed

HTTP/2 desync vulnerability; TRACE method enabled on backend; Cacheable responses; Victim visits a poisoned URL

The fix

The TRACE method should be disabled on production servers, and HTTP/2 header injection vulnerabilities should be fixed to prevent desync attacks.

How it was found

  1. Identify an HTTP/2 desync vulnerability that allows header injection.
  2. Use the desync to smuggle a HEAD request followed by a TRACE request with a malicious header.
  3. The TRACE response reflects the header, creating a malicious script in the response body.
  4. Use response concatenation to make the proxy treat the TRACE response as part of the HEAD response.
  5. Poison the cache with the crafted response so that other users receive the malicious script.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

HTTP request smuggling is a technique where an attacker sends a request that is interpreted differently by a front-end proxy and a back-end server, allowing them to sneak in a second request. The TRACE method is an old HTTP feature that echoes back whatever request it receives, which can be abused to reflect malicious content. By combining these, the attacker can make the server store a malicious script in its cache, so other users' browsers execute it.

What is Smuggling / CRLF?

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.

More by Martin Doyhenard

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.