Skip to content

Bug class · Advanced

Request smuggling and header injection

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.

median public bounty
$1,800

Covers CWE 444.

How it works

Full lesson

The pattern behind every report in this class.

Request smuggling and header injection are two closely related classes of bug that both come down to a disagreement or a missing check around HTTP message boundaries. Header injection happens when user-controlled data ends up in a response or protocol header without carriage return and line feed characters being stripped, so an attacker can add extra headers or split the response. Request smuggling happens when a front-end proxy and a back-end server parse the same request differently, usually because of conflicting or malformed framing headers, so one side sees two requests where the other sees one. The evidence covers both, from curl and libcurl across HTTP, SMTP, IMAP and gopher, through Node.js parsers, Ruby libraries, Tomcat, Apache modules and Cloudflare's ruleset engine, to plain web apps that build password reset links from the Host header.

Programs care because the impact is rarely limited to the endpoint you found. A smuggled request can poison a shared cache, steal another user's session, bypass front-end access controls, reach internal services or cloud metadata, or turn a password reset flow into account takeover. Header injection regularly chains into response splitting, cross-site scripting, cookie fixation, cache poisoning and credential theft. The reports here show hunters taking these bugs all the way to account takeover, session hijacking, remote code execution and internal origin access, which is why they sit among the higher-severity findings in the dataset.

The most common places to find them are front-end proxies and caches sitting in front of back-end servers that parse boundaries differently, password reset and newsletter flows that build links from the Host header, redirect endpoints and request paths that reflect input into response headers, and HTTP client and server libraries with loose parsing rules. The evidence also shows them on VPN and remote-access subdomains, documentation and API hosts, download endpoints, crypto and legal tech platforms, government hosts, and email sending infrastructure. Anywhere a request crosses a trust boundary between two parsers, or anywhere user input reaches a header, is worth a look.

Start with the framing headers. Every HTTP request has to tell the receiver where the body ends, either with a Content-Length or with Transfer-Encoding chunked. If a request carries both, or carries a malformed or duplicated Transfer-Encoding, different parsers can reach different conclusions about where the first request stops and the next one begins. The front end might read one request and forward it, while the back end reads the same bytes as two requests, the second of which the front end never inspected.

Things to try

All 307

Each line worked in a disclosed report. Test only what a program's scope allows.

CRLF injection fundamentals 28

  • Send a request whose URL or redirect parameter contains encoded newline characters followed by a cookie-setting header, and check whether the response carries the injected header.
  • Send a request with an encoded question mark in the path and check whether it is reflected into response headers.
  • Put an encoded line break in the request path and see whether the server reflects it into a response header.
  • Add a query parameter containing an encoded carriage return and line feed followed by a header name and value, then inspect the response headers.

Request smuggling via parser discrepancies 25

  • Test request smuggling on an email marketing platform host.
  • Test an email template service for request smuggling.
  • Send a crafted request and look for a delayed 504 response as an indicator of smuggling.
  • Smuggle a request for a path the front-end proxy blocks and check whether the backend serves it.

Header line ending and whitespace quirks 22

  • Send requests with unusual whitespace in the request line and check whether the front end and back end parse the request boundaries differently.
  • Send a request with a connection close token followed by a tab and append a second request after the body, then check whether the server logs two requests.
  • Vary the whitespace after the connection close token (space, tab, comma) and compare whether the connection is kept alive.
  • Send a Transfer-Encoding header with a space before the colon and check whether the front end and back end disagree on request boundaries.

Protocol smuggling to other services 20

  • Enter a malicious server address as a share URL and check whether the application writes to it.
  • Put protocol control characters in an LDAP password field and check whether they are interpreted as a different protocol.
  • Use the gopher protocol with values containing CRLF and check for arbitrary command injection.
  • Send a crafted request through mod_proxy_ajp and check whether the AJP backend interprets request boundaries differently.

Client-side desync 19

  • Send a smuggled prefix request followed by many normal requests and check whether a victim receives your response.
  • Use a desync to make the next legitimate request receive an error page and check for denial of service.
  • Smuggle a request that forces a victim's browser to follow a redirect to your server and check whether the session cookie is leaked.
  • Use a desync attack to capture other users' sessions and check for mass session hijacking.

Bypasses and variations

All 62
  • Point the reset link at your host via the Host header or X-Forwarded-Host.
  • Set the cookie on the parent domain rather than the subdomain.
  • Smuggle a request for a blocked path past the front-end proxy.
  • Split the response with a blank line and add a body.
  • Poison a cached redirect so a legitimate user is served your content.
  • Prepend a smuggled request to a victim's next request.

Typical fixes

All 34
  • Reject or strip carriage return and line feed characters from all values written into protocol lines.
  • Make front end and back end agree on request boundaries and reject ambiguous requests.
  • Validate the Host header and forwarded host headers against an allowlist before using them in links or redirects.
  • Build reset links from a configured host rather than the Host header.
  • Reject requests with both Transfer-Encoding and Content-Length, and reject malformed or multi-line Transfer-Encoding headers.
  • Strip carriage return and line feed characters from user input before placing it in a response header, including redirect handling.

Tips for beginners

All 14
  • Start where two parsers meet. A front-end proxy or CDN in front of a back-end server is the highest-value place to look, because that is where a boundary disagreement turns into a smuggled request. Look for hosts behind a cache, load balancer or reverse proxy, and check whether the front end and back end handle conflicting or malformed framing headers the same way.
  • Before hunting smuggling, hunt the simpler header injection. Send a request whose URL, redirect parameter or query value contains encoded newline characters followed by a header name and value, and inspect the response headers. If you see your injected header, you have a finding, and it often chains into response splitting, cookie injection or cross-site scripting.
  • Test password reset and newsletter flows with a modified Host header or X-Forwarded-Host. Request a reset and check whether the link in the email points at your host. If it does, that is host header injection with a clear path to account takeover, and it is one of the most commonly reported variants in this dataset.
  • When you find a cookie-setting header injection, try to set the cookie on the parent domain rather than the subdomain. If the application accepts it for the whole domain, the impact grows from a single subdomain to every subdomain, and that is worth showing explicitly in your report.
  • For smuggling, send a request with both Content-Length and Transfer-Encoding, with a smuggled request after the chunked body terminator, and check whether two responses come back on one connection. A delayed 504 response is also a useful indicator that something is desyncing, so watch for it on streaming and video subdomains.
  • Try obfuscating the Transfer-Encoding header rather than sending it plainly. A space before the colon, a tab, unusual casing, a multi-line value or a duplicate header can make one parser ignore it while the other honours it. The evidence shows this working against proxies, Node.js parsers, WEBrick and Squid, so it is worth trying on any host behind a proxy.

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on Smuggling / CRLF, from around the web.

Newest reports

All 300

Most recently disclosed.

New Smuggling / CRLF reports by email

Follow Smuggling / CRLF and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy