Bypassing Akamai’s Web Application Firewall Using an Injected Content-Encoding Header
A CRLF injection vulnerability allowed an attacker to inject headers and a compressed XSS payload into the HTTP response, bypassing Akamai WAF filtering. The attacker could execute arbitrary JavaScript in a victim's browser.
Published on praetorian.com
During a recent Chariot customer pilot we identified an interesting method to bypass the cross-site scripting (XSS) filtering functionality within the Akamai Web Application Firewall (WAF) solution. Chariot had identified a Carriage Return and Line Feed (CRLF) injection vulnerability during an automated scan, and we…
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 application reflected user input into an HTTP response header without sanitising CRLF characters, and the WAF did not inspect compressed response bodies.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially leading to session fixation or other attacks, though the WAF bypass was specific to Akamai and the CRLF injection was the root cause.
What the attacker needed
CRLF injection vulnerability in the application; Akamai WAF protecting the application; Victim visits a crafted URL
How it was found
- Confirm CRLF injection by injecting a newline character in the URL and observing a Set-Cookie header in the response.
- Inject a Content-Encoding header specifying deflate compression.
- Inject a compressed XSS payload that decompresses to a script tag.
- Inject a Content-Length header matching the compressed payload size to exclude residual headers.
- Trigger the payload in a victim's browser to execute the script.
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.
A CRLF injection lets an attacker insert new lines into a web server's response, which can add fake headers or change the page content. Here, the attacker used that to add a header saying the page was compressed, then hid a malicious script inside the compressed data so the firewall did not recognise it. When the victim's browser opened the page, it decompressed the data and ran the script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.