Iframe sandbox on Android do not prevent downloads from different sites
Firefox for Android allows downloads from a sandboxed iframe even when the allow-downloads attribute is not set, unlike other browsers. An attacker could use a malicious advertisement in a sandboxed iframe to serve a malicious APK from a trusted site, and the download origin is not shown, misleading the user.
- Fixed in 2.7 years
- Paid in 11 months
- Disclosed after 2.7 years
Created attachment 9295190
iframe-download.html
Despite MDN webdocs specifying that allow-downloads attribute is enabled on [Firefox for Android](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) since v82, Firefox for Android still continues to download files even when an iframe is sandboxed without the allow-downloads attributes set. This is a problem, because a malicious sandboxed advertisement may serve malicious APK to a site that a user trusts, bypassing the sandbox. The origin of the download site is not displayed too, leading users to believe that the victim site is the one serving the download.
STR
1. Open iframe-download.html on Firefox Android, prompt to download occurs (the download is the zipped source code for mozilla-mobile/fenix.)
2. Click "Download", the file is downloaded onto the Android system even with the iframe being sandboxed without allow-downloads present.
3. On contrast, loading iframe-download.html on Firefox for Desktop, Chrome for Desktop and Chrome for Android does not trigger the download.
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
Impact
A malicious sandboxed advertisement could serve a malicious APK to a site that a user trusts, bypassing the sandbox, and the origin of the download is not displayed, leading users to believe the victim site is serving the download.
What the attacker needed
Victim uses Firefox for Android; victim visits a site with a sandboxed iframe; attacker controls content in the iframe
How it was found
- Open the provided HTML file on Firefox for Android.
- Observe that a download prompt appears.
- Click 'Download' and the file is saved to the Android system.
- Compare with Firefox Desktop, Chrome Desktop, and Chrome for Android, which do not trigger the download.
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 sandboxed iframe is a way to embed content from another site with restricted permissions. The allow-downloads attribute is supposed to control whether that embedded content can trigger file downloads. In Firefox for Android, this restriction is missing, so a malicious ad inside a sandboxed iframe can still make the browser download a file, such as an Android app package (APK), without the user realising where it came from.
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.