Google Doodle - XSS (actually response splitting)
The Google Doodle website failed to sanitise carriage return and line feed characters in user input, allowing an attacker to inject arbitrary headers and body content into the HTTP response. This enabled cross-site scripting by splitting the response and bypassing Chrome's anti-XSS filter through a dash-to-underscore substitution.
Published on blog.bentkowski.info
The original lives on blog.bentkowski.info
We do not hold its text, 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 failed to strip carriage return and line feed characters from user-supplied input before including it in an HTTP header.
Impact
An attacker could execute arbitrary JavaScript in the context of the Google Doodle website, potentially leading to cross-site scripting attacks, though some common headers like Set-Cookie were blocked by the dash-to-underscore substitution.
What the attacker needed
Victim visits a crafted URL; Chrome browser (for the bypass)
The fix
The vulnerability was fixed by Google within two working days after being reported.
How it was found
- Supply input containing carriage return and line feed characters to the Doodle website.
- The server includes the unsanitised input in a response header, allowing injection of a custom header and JavaScript in the body.
- Use a dash-to-underscore substitution to make the injected JavaScript differ from the request, bypassing Chrome's anti-XSS filter.
- The browser executes the injected JavaScript, achieving XSS.
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.
When a web server sends a response, it separates the headers (instructions) from the body (content) using special newline characters. If a website puts user input into a header without removing these newline characters, an attacker can trick the server into sending extra headers or even a second response. Here, that let the attacker insert JavaScript that the browser would run, which is a cross-site scripting (XSS) attack.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.