Toutes les vulnérabilités
HIGHAppSec

APPSEC-REQUEST-SMUGGLING

Web app · HTTP Request Smuggling

Résumé

HTTP request smuggling (desync) happens when a front-end proxy and a back-end server reuse a TCP connection but disagree on where one HTTP request ends and the next begins, usually because one trusts the Content-Length header and the other trusts Transfer-Encoding: chunked. In a CL.TE attack the front-end uses Content-Length while the back-end uses Transfer-Encoding, so bytes the front-end considers part of the body are parsed by the back-end as the start of a second request; TE.CL is the inverse, often achieved by obfuscating the Transfer-Encoding header so only one server honors it. The smuggled prefix poisons the shared socket and is prepended to the next user's request, enabling cache poisoning, request hijacking, credential capture, and security-control bypass. James Kettle (PortSwigger) reintroduced and weaponized this class in 'HTTP Desync Attacks: Request Smuggling Reborn,' presented at Black Hat USA on 7 August 2019, with documented bounties against PayPal and others. The root cause is ambiguous message-boundary parsing across a server chain; CWE-444.

Comment l’éviter dans votre code

  • Normalize requests at the front-end and reject any with both Content-Length and Transfer-Encoding headers.
  • Use HTTP/2 end to end and avoid downgrading to HTTP/1.1 toward the back-end.
  • Reject malformed or obfuscated Transfer-Encoding values rather than tolerating them.
  • Disable connection reuse between front-end and back-end, or ensure both use identical parsers.
  • Drop ambiguous requests entirely instead of best-effort interpretation.

Références

Vulnérabilités liées

Tout AppSec →