Bypassing WAFs with the phantom $Version cookie
The article shows that different web frameworks parse legacy cookie attributes like $Version inconsistently, and that quoted cookie values can hide malicious payloads from WAFs. An attacker could use these discrepancies to bypass WAF detection and deliver SQL injection or command injection payloads.
portswigger.net
Published on portswigger.net
HTTP cookies often control critical website features, but their long and convoluted history exposes them to parser discrepancy vulnerabilities. In this post, I'll explore some dangerous, lesser-known features of modern cookie parsers and show how they can be abused to bypass web application firewalls.
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 root cause is that web servers and frameworks implement legacy cookie parsing (RFC2109) inconsistently, allowing quoted strings and special attributes to hide malicious content from WAFs.
What the attacker needed
Target uses a vulnerable cookie parser; WAF inspects cookie values; attacker can send crafted Cookie headers
The fix
Legacy RFC2109 support should be disabled on the web server unless explicitly required, and all user inputs should be rigorously validated.
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 that websites store in your browser. Different web servers read cookies in slightly different ways, and this article shows that an attacker can craft a cookie that looks harmless to a security filter (a WAF, or web application firewall) but is actually dangerous when the server reads it. The trick involves old cookie rules that let you put special characters inside quotes, so the filter sees a quoted string while the server sees a command.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.