Focus ignores `Content-disposition: attachment` and binary content-types that should be downloaded, creates XSS on sites allowing user uploads
Firefox Focus ignores the Content-Type and Content-Disposition headers that should force a download, so uploaded files are rendered inline instead. An attacker could upload a malicious file to a site that hosts user content and get script execution in the browser on that site's origin.
Originally disclosed on Mozilla
- Fixed in 9 days
- Paid in 15 days
- Disclosed after 9 days
Created attachment 9499283
file.exe.download.php
Firefox Focus ignores both `Content-Type: application/octet-stream` and `Content-Disposition` headers which means any downloadable file with any MIME or extension is getting rendered inside the browser instead of a download, this will lead to XSS attacks in all of the sites that allows file uploads.
POC: (Using Google Drive to upload a file and getting an XSS on *.google.com)
https://drive.usercontent.google.com/u/0/uc?id=1MC2X5-GRa741N6V160rbpMv2DyfBHaY_&export=download
Video POC: (Showing the file is getting downloaded in Firefox but rendered in Focus)
https://drive.google.com/file/d/1cF40oMr6foTYJ2uGnzLOlPTxqUKSqnkC/view?usp=sharing
Test case attached as a file
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the browser does not honour Content-Disposition and Content-Type download directives, so it renders attacker-supplied content inline on the hosting site's origin.
Impact
On sites that allow user uploads, an attacker could achieve cross-site scripting on the site's origin; the report demonstrates this on a Google domain.
What the attacker needed
Firefox Focus browser; site allows user file uploads; victim opens the file link
How it was found
- Upload a file to a site that allows user uploads, such as Google Drive.
- Open the download link for that file in Firefox Focus.
- Observe that the file is rendered in the browser instead of being downloaded.
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 report has not been written yet. The Original tab links to the source.
When a website sends a file, it can add headers telling the browser to save it rather than display it. Firefox Focus ignores those instructions and shows the file in the page instead. If the file contains code, that code can run as if it came from the website, which is called cross-site scripting.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.