FireFox iOS Allow-Downloads Iframe Sandbox Vulnerability
A sandboxed iframe in Firefox iOS could trigger a file download via window.open despite the sandbox lacking allow-downloads. An attacker could embed such an iframe to trick users into downloading malicious files.
Originally disclosed on Mozilla
- Fixed in 10 months
- Paid in 10 months
- Disclosed after 10 months
Summary:
The vulnerability arises due to the improper handling of downloads triggered by a sandboxed iframe using window.open. This allows bypass of sandbox security restrictions and potentially trick users into downloading malicious files.
Tested Environment:
FireFox iOS Version 129.1 (Vulnerable) , Running on iOS 17.6.1 via iPhone 12 FireFox Mac (Not Vulnerable) Safari iOS/Mac and Chrome iOS/Mac (Not Vulnerable) I didn't tested on Mozilla Android and Windows, please confirm from your end.
Technical Details:
The iframe have following sandbox.
<iframe src="iframe.html" sandbox="allow-scripts allow-popups"></iframe>
According to the HTML5 specification, the sandbox attribute should restrict certain actions within the iframe, such as script execution, form submission, and file downloads. However, using this vulnerability an iframe can bypass download restrictions by invoking window.open on a download URL, such as a .zip file.
Example:
window.open('/download.zip');
In this scenario, the server sets the Content-Disposition header to attachment, which instructs the browser to treat the file as a download. The vulnerability allows the download to proceed even when the iframe is sandboxed, which should not typically allow such behavior.
Impact:
An attacker can exploit this vulnerability by embedding a malicious iframe in a trusted web application and tricking users into downloading harmful files.
####POC Video Link - https://drive.google.com/file/d/1cSx6WAM1vF-jy5wsHT7IATIeNwL5H7nS/view?usp=sharing
Steps to Reproduce:
- Download all files from here https://drive.google.com/file/d/1NPoQkX8bIBYI3bB6LIsGpnXiHADkImlQ/view?usp=sharing and extract and place in same directory.
- Go to that directory via command line and fire this command "node node.js" this will start a server on localhost port 8000
- From Mozilla iOS visit the web page your local ip of node js server ex. Mine was http://192.168.220.19:8000/index.html
- Once opened, click inside the iframe and you should see a download prompt.
References:
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 did not properly check the sandbox flags when a download was initiated through window.open from a sandboxed iframe.
Impact
An attacker could embed a malicious iframe in a trusted site to trick users into downloading harmful files, though the issue was only confirmed on Firefox iOS.
What the attacker needed
Firefox on iOS; victim visits a malicious page; victim clicks inside the iframe
How it was found
- Download and extract the provided files into the same directory.
- Run the node server with the command 'node node.js' to start it on localhost port 8000.
- On Firefox iOS, visit the local IP address of the server, e.g., http://[redacted]:8000/index.html.
- Click inside the iframe and observe a download prompt.
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.
A sandbox is a security feature that restricts what content inside an iframe can do, like stopping downloads. Here, Firefox on iPhone failed to enforce that restriction, so a malicious page could make a file download without the user expecting it.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.