XSS via file upload - www.google.com (Postini Header Analyzer)
The Postini Header Analyzer on www.google.com displayed uploaded archive file names without sanitisation, allowing an attacker to inject script via a crafted file name. By manipulating the Content-disposition header, the attacker could upload a file without user interaction, leading to XSS.
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 sanitise file names extracted from uploaded archives before displaying them in the HTML page.
What the attacker needed
Victim visits a malicious page; victim uses a vulnerable browser (Firefox/Chrome); attacker crafts a special archive file
How it was found
- Create a zip file containing a file with an XSS payload in its name.
- Upload the zip file to the Postini Header Analyzer.
- Observe that the file name is displayed and the script executes.
- To avoid user interaction, craft a POST request with a manipulated Content-disposition header that includes the file data and a malicious filename.
- Send the crafted request (e.g., via a form) to upload the file without the victim's knowledge.
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.
This report describes a cross-site scripting (XSS) bug. XSS lets an attacker run their own JavaScript in a victim's browser on a trusted website. Here, the website showed the names of files inside an uploaded archive without cleaning them, so a malicious file name could contain code that runs when the page displays it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.