Reading list
Learn Smuggling / CRLF from real reports
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.
12 reports, easiest first.
-
#BugBounty — Exploiting CRLF Injection can lands into a nice bounty
The web application did not sanitise user input reflected in HTTP response headers, allowing CRLF injection. An attacker could inject a Location header to redirect victims to a malicious site.
When a website sends a response, it includes headers that tell the browser what to do, like where to redirect. If the site puts user input directly into these headers without cleaning it, an attacker can add extra line breaks (CRLF) to insert their own headers. This can make the browser go to a malicious site.
The lesson. Likely the application passed user-supplied input directly into HTTP response headers without sanitising or encoding CRLF characters.
-
CRLF Injection in `--proxy-header` allows extra HTTP headers (CWE-93)
curl does not validate the value passed to --proxy-header, so a user can inject carriage return and line feed characters to create additional HTTP headers in the proxy request. An attacker could use this to bypass security filters or spoof headers like X-Forwarded-For.
When a program sends data over the network, it uses special line breaks to separate different parts of the message. If a user can put those line breaks into a value that is supposed to be a single header, they can trick the program into sending extra headers that were not intended. This is called CRLF injection because CR and LF are the codes for carriage return and line feed.
The lesson. Likely the add2list function in curl's command-line tool does not check for carriage return or line feed characters before passing the header value to curl_slist_append, which then sends it as-is in the HTTP request.
-
CRLF Injection on https://vpn.mixmax.com
The VPN login endpoint reflected a URL-encoded newline into an HTTP response header, allowing an attacker to inject an arbitrary Set-Cookie header. An attacker could set cookies on the victim's browser for that domain.
When a web server builds its reply, it separates headers (like Set-Cookie) with special newline characters. If a user-supplied part of the URL is copied into a header without cleaning, an attacker can sneak in their own newline and add extra headers. Here the attacker added a cookie header, so the victim's browser would store a cookie the attacker chose.
The lesson. Likely the application placed part of the request path into a response header without stripping carriage-return and line-feed characters.
-
CRLF Injection ‘How to Hunt it’
A legacy redirect endpoint on an IBM subdomain passed user-controlled input into the Location response header without filtering CR and LF characters. An attacker could inject arbitrary response headers, including a Set-Cookie header for the ibm.com domain.
Web servers send extra information called headers with every response. If a website puts something you typed into a header without cleaning it, you can sneak in line breaks and add your own headers. Here the researcher added a cookie-setting header, which could let an attacker plant a cookie on a trusted domain.
The lesson. The redirect endpoint placed user-controlled path input into the Location header without stripping carriage-return and line-feed characters.
-
CRLF Injection Into PHP’s cURL Options
A PHP application passed user-controlled cookie data into a cURL HTTP header without sanitising CRLF characters. An attacker could inject arbitrary headers and POST data into the internal API request, potentially calling unintended methods.
When a web server sends a request to another server, it uses headers to give extra information. If a user can put special newline characters into a header value, they can trick the server into thinking the request has ended and start writing their own headers or even the body of the request. This is called CRLF injection.
The lesson. The application did not validate or sanitise user input before using it in a cURL header option, allowing CRLF sequences to be interpreted as header separators.
-
HTTP Request Smuggling via Connection: close<TAB> in Node.js llhttp parser
Node.js's HTTP parser fails to honour a Connection: close header when the token is followed by a tab, keeping the connection alive and treating trailing bytes as a second request. An attacker can send one TCP payload that the application sees as two requests, enabling request smuggling or desynchronisation with front-end proxies.
When a web server sees 'Connection: close' it should stop reading after that request. Here, adding a tab character after 'close' tricks Node into ignoring that instruction, so extra data sent in the same network packet is treated as a second request. This can let an attacker sneak an extra request past a proxy that thinks the connection is finished.
The lesson. Likely a bug in llhttp's Connection token parser: after recognising 'close', it accepts comma, space, CR and LF but not HTAB, and the HTAB fallback drops the pending CONNECTION_CLOSE state.
-
Smuggling SIP headers past Session Border Controllers FTW!
Kamailio's remove_hf() function failed to strip SIP headers whose names contained a trailing space or tab, allowing an attacker to smuggle headers past the session border controller to downstream systems like Asterisk. This could enable toll fraud, billing other customers, and caller-ID spoofing.
A session border controller (SBC) is a security device that sits between phone networks and removes dangerous headers from messages. The bug was that Kamailio's removal function didn't recognise a header if there was an extra space after its name, so the header slipped through to the internal phone system, which then trusted it.
The lesson. Likely Kamailio's remove_hf() function did not correctly parse header names that included trailing whitespace, while the downstream SIP parser (pjsip in Asterisk) did.
-
$8,200 for Two Invisible Characters: CRLF Injection to Session Fixation
The login redirect parameter was reflected into a response header without stripping carriage-return and line-feed characters, allowing an attacker to inject arbitrary headers. By injecting a Set-Cookie header, an attacker could fixate a victim's session to a known identifier and then access the authenticated session after the victim logged in.
When a website sends a response, it uses special line-break characters to separate different parts of the response, called headers. If a website puts user input into a header without removing those line breaks, an attacker can add extra headers. Here, the attacker added a header that set a cookie, which is a small piece of data a website stores in your browser to remember you. By setting a cookie the attacker already knows, the attacker could later use that same cookie to access the victim's account after the victim logs in.
The lesson. The application concatenated the user-supplied returnUrl parameter directly into the raw HTTP header block without stripping or encoding carriage-return and line-feed sequences.
-
CUJO Smart Firewall safe browsing Host header-parsing firewall bypass vulnerability
The CUJO Smart Firewall's safe browsing function parses individual TCP packets and extracts the Host header using a regular expression that fails when the HTTP request is split across multiple packets. An attacker can bypass the firewall's malicious website filtering by sending a request with an overlong path, causing the Host header to appear in a later packet that does not match the pattern.
The firewall tries to block bad websites by reading the web address (Host header) from each network packet. But if a request is split into two packets, the firewall only sees part of the request and misses the Host header, so it lets the traffic through. An attacker can deliberately split the request to sneak past the filter.
The lesson. The firewall inspects individual TCP packets rather than reassembling the full HTTP stream, so its regular expression fails to extract the Host header when the request is fragmented.
-
SMTP Command Injection via CRLF in libcurl MAIL_FROM / MAIL_RCPT (lib/smtp.c)
libcurl's SMTP implementation fails to sanitise CRLF sequences in the MAIL_FROM and MAIL_RCPT options, allowing an attacker to inject arbitrary SMTP commands. This can lead to unauthorised recipient injection, manipulation of the SMTP transaction, and injection of full email content.
When a program sends email using libcurl, it can specify the sender and recipient addresses. If an attacker can control these addresses, they can sneak in extra line breaks and commands, tricking the email server into sending the message to unintended recipients or adding malicious content. This happens because libcurl does not check for special characters that should not appear in email addresses.
The lesson. The function smtp_parse_address() extracts the suffix after the closing '>' and uses it without validating or sanitising control characters, unlike other SMTP parsing paths that apply REJECT_CTRL.
-
SMTP Protocol Injection via CRLF in CURLOPT_MAIL_FROM leading to Email Spoofing
libcurl does not sanitise the CURLOPT_MAIL_FROM option for CRLF sequences, allowing an attacker to inject arbitrary SMTP commands. This can bypass recipient allow-lists and enable email spoofing.
When a program sends email using a library, it tells the library who the sender is. This report shows that the library does not check that sender address for hidden newline characters. An attacker can put extra email commands after the sender address, and the library will send them to the email server as if they were separate instructions.
The lesson. Likely the CURLOPT_MAIL_FROM option is stored without validating for control characters, unlike full URLs which are checked by Curl_junkscan.
-
CRLF Injection in HAProxy PROXY Protocol via CURLOPT_HAPROXY_CLIENT_IP allows IP spoofing and protocol injection
The CURLOPT_HAPROXY_CLIENT_IP option in libcurl accepts arbitrary strings without validation and inserts them into the HAProxy PROXY protocol header. An attacker who can control this value can inject CRLF sequences to spoof source IP addresses and smuggle HTTP requests to backend servers that trust the PROXY protocol.
The PROXY protocol is a way for a proxy to tell a backend server the real IP address of a client. libcurl has an option to set this client IP, but it does not check that the value is actually an IP address. If an attacker can control that value, they can insert extra lines to fake their IP or add a whole new request, tricking the backend into trusting them.
The lesson. Likely the CURLOPT_HAPROXY_CLIENT_IP option stores the user-supplied string without validating it as an IP address, and the string is then formatted directly into the PROXY protocol header.