Cookie Bugs Smuggling & Injection
Several web servers and frameworks parse cookie headers incorrectly, allowing an attacker who controls one cookie value to smuggle or inject additional cookies. This can bypass cookie-based CSRF protection, spoof security-prefixed cookies, or cause authorization bypasses when cookies are forwarded to a backend.
Published on blog.ankursundara.com
Recently, I investigated how browsers encode & send cookies, and how they are parsed by various web frameworks. Here's some documentation of bugs (+CVE) and interesting behavior I found.
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 servers use outdated or incorrect cookie parsing rules (such as RFC2965 quoted strings or non-semicolon delimiters) that do not match how browsers actually send cookies.
Impact
An attacker who can control a single cookie value could bypass cookie-based CSRF protection, spoof __Secure- or __Host- cookies, or cause authorization bypasses when cookies are passed to a vulnerable backend.
What the attacker needed
Attacker controls one cookie value; server uses vulnerable cookie parser
The fix
The affected servers and libraries should be updated to parse cookies according to RFC6265, treating only semicolons as delimiters and not continuing quoted values across semicolons.
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.
Cookies are small pieces of data a website stores in your browser and sends back with each request. The server reads them to know who you are or to check security tokens. This report shows that some servers read the cookie text in a sloppy way, so if an attacker can set just one cookie, they can trick the server into thinking they also set other cookies, like a security token.
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.