Skip to content
UI spoofing Disclosed report Intermediate CVE-2023-29540

allow-top-navigation-to-custom-protocols iframe sandbox bypass using sourceMappingUrls

A sandboxed iframe without the allow-top-navigation-to-custom-protocols flag could still trigger external protocol dialogs by using a redirect embedded in sourceMappingUrls. An attacker could launch external applications without a user gesture, which is useful for malvertising.

haxatron1 Follow

Originally disclosed on Mozilla

  • Fixed in 6 months
  • Paid in 6 months
  • Disclosed after 6 months
Text
Created attachment 9294375
source-map.html

Using a redirect embedded into sourceMappingUrls it is possible to navigate to external protocol links in sandboxed iframes without allow-top-navigation-to-custom-protocols, (without a user gesture even!).

1. Host source-map.html and redirect.php on site 1 (attacker site), iframe.html on site 2 (victim site), as always change the URL present in the source-map.html and iframe.html files.
2. Open iframe.html in victim site, external protocol dialog will launch even with allow-top-navigation-to-custom-protocols absent. 

Very useful for malvertisers as it also bypasses the user gesture requirement for external protocols.

The original report as published on Mozilla's Bugzilla, by haxatron1. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 enforce the sandbox flag when processing redirects from sourceMappingUrls, allowing navigation to custom protocols.

Impact

An attacker could trigger external protocol dialogs without user interaction, which could be abused for malvertising.

What the attacker needed

Attacker controls a website; victim visits a page with a sandboxed iframe

How it was found

  1. Host source-map.html and redirect.php on the attacker site, and iframe.html on the victim site, updating the URLs in the files.
  2. Open iframe.html on the victim site.
  3. Observe that the external protocol dialog launches even though allow-top-navigation-to-custom-protocols is absent.

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 web page embedded in another page with restricted permissions. Normally, a sandboxed iframe cannot open external applications (like a custom protocol handler) unless the site explicitly allows it. This report shows a way to bypass that restriction by using a redirect in a source map URL, so the external application opens without the user clicking anything.

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.

More by haxatron1

View all

30 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Clickjacking and UI spoofing

The lesson behind this report.

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.