Skip to content
UI spoofing Disclosed report Intermediate CVE-2024-5691

Iframe sandbox bypass via clickjacking on the native XFO error page.

A sandboxed iframe on a page that uses X-Frame-Options to block embedding still shows an 'Open Site in New Window' button that does not check the sandbox flags. An attacker can overlay this button with a clickjacking lure, tricking the victim into clicking it to open a new window or start a download, bypassing the iframe sandbox.

Luan Herrera Follow

Originally disclosed on Mozilla

  • Fixed in 34 days
  • Paid in 46 days
  • Disclosed after 34 days
Text
Created attachment 9394020
repro-video.mov

A sandboxed iframe is not supposed to be able to initiate downloads or open popups unless the "allow-downloads" or "allow-popups" flags are respectively set. However, it is possible to trick users into clicking on the "Open Site in New Window" button that is displayed in error pages that opt-out from being embedded through the usage of the X-Frame-Options header. This functionality currently does not check whether the page is sandboxed before opening the new window, effectively allowing a clickjacking attack to occur on it and thus bypass the iframe sandbox protections.

A simple fix for this issue would be to disable the "Open Site in New Window" button if the iframe is sandboxed without the proper flags being set (allow-popups and allow-downloads).

For the attack to work, it requires the victim to click once inside a malicious iframe. The PoC provided just places opacity over the iframe to demonstrate that it would be possible to completely overlay the native Firefox error page and display whatever the attacker wanted instead.

I have attached a video (repro-video) reproducing the attack.

VERSION
Version: 124.0.1 (64-bit).
Operating System: MacOS 14.1.1 (23B81).

REPRODUCTION CASE
1. Access https://lbherrera.github.io/lab/firefox/iframe-sandbox/victim-0019884.html
2. Click on the first "Open Site in New Window"  button and a new window will open.
3. Click on the second "Open Site in New Window"  button and a download will start.

CREDIT INFORMATION
Reporter credit: Luan Herrera (@lbherrera_)

The original report as published on Mozilla's Bugzilla, by Luan Herrera. 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 'Open Site in New Window' button on the X-Frame-Options error page does not check whether the iframe is sandboxed without allow-popups and allow-downloads before performing the action.

Impact

An attacker could trick a victim into clicking a disguised button to open a new window or start a download from a sandboxed iframe, bypassing the sandbox restrictions; the attack requires one click inside a malicious iframe.

What the attacker needed

Victim clicks once inside a malicious iframe; attacker can overlay the error page button

The fix

The 'Open Site in New Window' button should be disabled when the iframe is sandboxed without allow-popups and allow-downloads.

How it was found

  1. Access the provided reproduction page.
  2. Click the first 'Open Site in New Window' button and a new window opens.
  3. Click the second 'Open Site in New Window' button and a download starts.

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 another page with restrictions, such as not allowing popups or downloads. The error page shown when a site refuses to be embedded has a button to open the site in a new window, but it does not respect those restrictions. An attacker can put an invisible layer over that button so a victim clicks it, and the new window or download happens despite the sandbox.

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 Luan Herrera

View all

11 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.