iframe sandboxing top-navigation bypass on Android via intent: url scheme
An iframe with standard ad-serving sandbox attributes, including allow-top-navigation-by-user-activation, should block uninitiated top-level redirects. On Firefox for Android, setting the iframe's location to an intent: URL launches Chrome and opens an attacker page without user interaction, enabling forced mobile redirections in malvertising campaigns.
Originally disclosed on Mozilla
- Fixed in 15 months
- Paid in 8 months
- Disclosed after 15 months
Hi Team,
This bug is actively being exploited by a prolific malvertiser known as Zirconium in order to serve millions of forced mobile redirections via malicious ad campaigns.
Here's a reference for more information about Zirconium:
https://blog.confiant.com/uncovering-2017s-largest-malvertising-operation-b84cd38d6b85
The bug:
Consider an iframe with the following sandboxing attributes:
"allow-forms allow-pointer-lock allow-popups-to-escape-sandbox allow-popups allow-same-origin allow-scripts allow-top-navigation-by-user-activation"
These are standard sandbox attributes for ad serving, and they're generally meant to mitigate things like forced redirections that are uninitiated. Especially the "allow-top-navigation-by-user-activation" attribute.
Most browsers will block something like this in such an iframe:
top.location.href="http://malicious_landing_page";
Firefox on Android will prevent this redirection as well. However, it will not prevent spawning a redirect that's done in this manner:
location.href = "intent://malicious_landing_page/#Intent;scheme=https;package=com.android.chrome;end";
This payload will spawn Google Chrome from Firefox and open the malicious page without any user interaction. It will also spawn if the allow-popups attribute isn't present. All other major browser successfully prevent this.
This is currently being heavily abused in an ongoing malvertising campaign which is specifically targeting Firefox on Android. We strongly recommend that this be addressed with some urgency as that will have a direct impact on the malvertiser's financial success with this campaign.
This has been tested in the latest Firefox on Android 9 - Samsung Galaxy S8+ as well as several Browserstack instances.
Happy to answer any questions you might have.
Best,
Eliya
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 Android intent: URL scheme handler is not subject to the iframe sandbox's top-navigation restrictions, so a sandboxed frame can trigger an external app launch.
Impact
A sandboxed ad iframe can force a redirect to an attacker page on Firefox for Android, which is being abused in a malvertising campaign; other major browsers block it.
What the attacker needed
Firefox on Android; victim views a page with a malicious ad iframe; no user interaction needed
How it was found
- Embed an iframe with the listed sandbox attributes.
- Set the iframe's location to an intent: URL pointing to a malicious page.
- Observe that Firefox for Android launches Chrome and opens the page without user interaction.
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.
Web pages can embed other pages in a box called an iframe, and a sandbox attribute restricts what that embedded page can do. One restriction is that it should not be able to navigate the whole browser window to a new site unless the user clicks something. On Firefox for Android, a special intent: link inside the iframe bypasses this and opens another browser app to a malicious page automatically.
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.