Skip to content
UI spoofing Disclosed report Intermediate

Clickjacking screenshot taker leads to cross origin info disclosure

The screenshot iframes inserted into web pages could have their CSS overridden, allowing an attacker to take a screenshot of a cross-origin website without the user's knowledge and read the screenshot data from a data URI. This led to cross-origin information disclosure.

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 18 months
  • Paid in 18 months
  • Disclosed after 18 months
Text
Created attachment 8936378
dndscreen.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce:

I noticed that the screenshot iframes inserted in web can have their CSS changed. By setting their style attribute we can override all its styles. I then noticed that we can take a screenshot of entire website (even things outside its visible body). Finally, I noticed the screenshot preview is data uri which contains all of the data of the screenshot conveniently in base64.

Combining all of the above I think I came up with a pretty convincing PoC.

Video of it in action: https://www.youtube.com/watch?v=De--NcpZofM (note: in the video I use 0.5 opacity for your clarity, it can be lowered to 0 for full effect)


Actual results:

Screenshot of cross origin website is taken unbeknownst to the user, as well as the data grabbed for said screenshot.




Expected results:

I think the simplest solution is to serve the screenshot preview through blob: URI. Then all you are left with is a cross origin blob url which can't be read from any normal web content.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is Firefox's screenshot feature, specifically the screenshot iframes that the browser inserts into web pages. The researcher reported that these iframes can have their CSS changed by the page: setting the iframe's style attribute overrides all of its styles. From there, two further observations combined into an attack. First, the screenshot can cover an entire website, including content outside the visible body. Second, the screenshot preview is delivered as a data URI, so the full image sits in the page as base64.

The researcher supplied a proof of concept file, dndscreen.html, and a video of it running. The video uses 0.5 opacity so the effect is visible; the report notes the opacity can be lowered to 0 for the full effect.

The stated user agent was:

Text
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

The actual result, in the researcher's words: a screenshot of a cross-origin website is taken without the user knowing, and the data for that screenshot is grabbed. The report is titled as clickjacking leading to cross-origin information disclosure, and the platform records it as medium severity, disclosed on 3 June 2019. The report itself gives no bounty figure and no fix commit.

Root cause

The screenshot iframe is inserted into page content and the page can override its styles by setting the style attribute. Because the page can set the iframe's style attribute, it controls how the iframe is presented, and the screenshot it produces can be captured over content the page should not be able to read. The second half of the problem is the delivery format: a data URI preview is same-origin readable content, so once the image is rendered the page can read the base64 payload with ordinary DOM access. The report notes the preview is a data URI containing the screenshot in base64.

Impact

An attacker page can cause Firefox to screenshot a cross-origin site, including parts of it outside the visible body, without the user being aware, and then read the resulting image data. That is cross-origin information disclosure: content the attacker's origin could not otherwise read becomes available to it. The report does not enumerate which sites or data were exposed, and the severity recorded is medium.

How this kind of bug works

Browser features that composite content from other origins into the page are a classic disclosure surface. If the browser injects an element into the DOM, the page's CSS applies to it unless the browser shields it, for example with a closed shadow root, a separate process boundary, or styles the page cannot override. If the page can resize, reposition or make the element transparent, it can place the captured content under its own overlay and use clickjacking style tricks to make the user trigger the capture, or simply trigger it programmatically where the feature allows.

The second ingredient is how the result comes back. A blob: URL is tied to the origin that created it, so a page from another origin cannot read it. A data: URI is inline content: once it is in the DOM, script on the page can read the string, decode the base64 and recover the pixels. Any feature that returns sensitive rendered content as a data URI to page script has this problem.

How to test for it

  1. Identify browser or extension features that inject UI into web pages: screenshot tools, preview panes, translation bubbles, password managers, reader modes.
  2. Inspect the injected element. Check whether the page can select it, read its attributes, or override its styles. Setting a style attribute on it and observing a visual change is a positive signal.
  3. Look at how results are delivered. If a preview, thumbnail or export appears as a data: URI in the DOM, try reading it from page script and decoding it.
  4. Test the capture scope. If the feature can capture beyond the viewport, point it at a cross-origin page loaded in a frame or tab and see what ends up in the image.
  5. Confirm the disclosure end to end: the page script must obtain pixel data from a cross-origin source it could not otherwise read. A screenshot the page cannot read is not a finding.

Common false positives: the iframe is visible but its content is not readable by the page; the preview is a blob: URL the page cannot fetch; the capture only covers same-origin content; or the page can restyle the element but the resulting image never reaches page-readable storage. Also check whether a user gesture is genuinely required, since a clickjacked gesture still counts but changes how you demonstrate it.

How it is fixed

The report proposes serving the screenshot preview through a blob: URI, leaving a blob URL that cannot be read from normal web content. Beyond that, the standard fixes are to isolate the injected UI so page CSS cannot override it, for example with a closed shadow root or browser chrome level rendering, and to restrict what the capture can include to content the initiating context is allowed to see.

Hunting notes

This class hides in browser features and extensions that render page content into a preview: screenshot and PDF export tools, link previews, thumbnail generators, and any UI injected into arbitrary pages. Recon signals include injected iframes or shadow hosts appearing in the DOM of ordinary sites, preview elements whose src starts with data:, and style attributes on browser-injected nodes that the page can change. To get a report accepted, show the full chain: page controlled styling, an unaware or clickjacked user, a cross-origin capture, and page script reading the resulting data. A clear video with reduced opacity, as in this report, makes the mechanism easy for a triager to follow.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Firefox has a built-in screenshot tool. When you use it, the browser inserts a small frame into the web page you are looking at, and that frame shows the screenshot preview. The researcher found that a website can change how this frame looks, because the page is allowed to set the frame's style attribute, which overrides all of the frame's styling.

Two more observations turned this into a real attack. First, the screenshot can cover an entire website, including parts that are outside the visible area of the page. Second, the preview image is delivered as a data URI, which means the whole picture sits inside the page as base64 text. Base64 is a way of writing binary data, such as an image, using only ordinary text characters.

Put together, a malicious page can make Firefox take a screenshot of another website without the user noticing, and then read the image data back. The researcher supplied a proof of concept file called dndscreen.html and a video of it running. In the video the frame is set to 0.5 opacity so the effect is easy to see; the report notes it can be lowered to 0 for the full effect.

The stated user agent was:

Text
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

A user agent is the short string a browser sends to identify itself. The actual result, in the researcher's words, is that a screenshot of a cross-origin website is taken unbeknownst to the user, and the data for that screenshot is grabbed. "Cross-origin" means the page doing the reading belongs to a different website from the content being read; normally the browser stops one site from reading another site's content.

The report is titled as clickjacking leading to cross-origin information disclosure. Clickjacking is a trick where a page places invisible or disguised elements over something else so that the user's clicks or the browser's actions happen on content the attacker does not own. The platform records the issue as medium severity, disclosed on 3 June 2019. The report gives no bounty figure and no fix commit.

Root cause

The screenshot frame is inserted into page content and the page can override its styles by setting the style attribute. CSS is the language that describes how a page looks. Because the page can set the frame's style attribute, it controls how the frame is presented, and the screenshot it produces can be captured over content the page should not be able to read.

The second half of the problem is the delivery format. A data URI is inline content, so once the image is rendered the page can read the base64 payload with ordinary access to the page's structure. The report notes the preview is a data URI containing the screenshot in base64.

Impact

An attacker page can cause Firefox to screenshot a cross-origin site, including parts of it outside the visible body, without the user being aware, and then read the resulting image data. That is cross-origin information disclosure: content the attacker's origin could not otherwise read becomes available to it. The report does not list which sites or data were exposed, and the severity recorded is medium.

In general, how this kind of bug works

Browser features that mix content from other origins into a page are a classic disclosure surface. If the browser injects an element into the page, the page's CSS applies to it unless the browser shields it, for example with a closed shadow root (a hidden internal structure the page cannot reach into), a separate process boundary, or styles the page cannot override. If the page can resize, reposition or make the element transparent, it can place the captured content under its own overlay and use clickjacking style tricks to make the user trigger the capture, or simply trigger it where the feature allows.

The second ingredient is how the result comes back. A blob: URL is tied to the origin that created it, so a page from another origin cannot read it. A data: URI is inline content: once it is in the page, script on the page can read the string, decode the base64 and recover the pixels. Any feature that returns sensitive rendered content as a data URI to page script has this problem.

In general, how to test for it

  1. Identify browser or extension features that inject interface elements into web pages: screenshot tools, preview panes, translation bubbles, password managers, reader modes.
  2. Inspect the injected element. Check whether the page can select it, read its attributes, or override its styles. Setting a style attribute on it and observing a visual change is a positive signal.
  3. Look at how results are delivered. If a preview, thumbnail or export appears as a data: URI in the page, try reading it from page script and decoding it.
  4. Test the capture scope. If the feature can capture beyond the visible area, point it at a cross-origin page loaded in a frame or tab and see what ends up in the image.
  5. Confirm the disclosure end to end: the page script must obtain pixel data from a cross-origin source it could not otherwise read. A screenshot the page cannot read is not a finding.

Common false positives: the frame is visible but its content is not readable by the page; the preview is a blob: URL the page cannot fetch; the capture only covers same-origin content; or the page can restyle the element but the resulting image never reaches page-readable storage. Also check whether a user gesture is genuinely required, since a clickjacked gesture still counts but changes how you demonstrate it.

In general, how it is fixed

The report proposes serving the screenshot preview through a blob: URI, leaving a blob URL that cannot be read from normal web content. Beyond that, the standard fixes are to isolate the injected interface so page CSS cannot override it, for example with a closed shadow root or rendering at the level of the browser's own interface, and to restrict what the capture can include to content the initiating context is allowed to see.

In general, where to look

This class hides in browser features and extensions that render page content into a preview: screenshot and PDF export tools, link previews, thumbnail generators, and any interface injected into arbitrary pages. Signals worth watching for include injected frames or shadow hosts appearing in the page structure of ordinary sites, preview elements whose src starts with data:, and style attributes on browser-injected nodes that the page can change. To get a report accepted, show the full chain: page controlled styling, an unaware or clickjacked user, a cross-origin capture, and page script reading the resulting data. A clear video with reduced opacity, as in this report, makes the mechanism easy for a triager to follow.

Glossary

  • Iframe: a frame inside a web page that loads another page or piece of content.
  • CSS: the language that describes how a page looks, including size, position and transparency.
  • Style attribute: an attribute on an element that sets its styling directly, overriding other style rules.
  • Data URI: a way of embedding content, such as an image, directly inside a page as text.
  • Base64: a text encoding for binary data, so an image can be carried as ordinary characters.
  • Blob URL: a link to content created by a page, tied to the origin that created it.
  • Origin: the combination of scheme, host and port that identifies a website; browsers use it to decide what one site may read from another.
  • Cross-origin: belonging to a different origin from the page doing the reading.
  • Clickjacking: disguising or overlaying elements so a user's action or the browser's action happens on content the attacker does not own.
  • Information disclosure: leaking data to someone who should not be able to read it.
  • User agent: the string a browser sends to identify itself.
  • Shadow root: a hidden internal structure attached to an element that page styles and scripts cannot reach into.
  • Proof of concept: a small demonstration that shows a bug can actually be exploited.
  • Triager: the person who reviews a security report and decides whether it is valid.

More by Abdulrahman Alqabandi

View all

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