Web content can receive and dispatch events used by the screenshot component
Web content could observe and dispatch custom events used by Firefox's Screenshots component, allowing a malicious page to trigger actions like copying to the clipboard or downloading files. The reporter demonstrated that a test case could modify the user's clipboard and downloads folder.
Originally disclosed on Mozilla
- Fixed in 14 hours
- Paid in 21 days
- Disclosed after 14 hours
Created attachment 9389405
reduced.html
These events can be observed by web content. Additionally, web content can dispatch these events and the Screenshots component will respond! Not good...
- Screenshots:Close
- Screenshots:Copy
- Screenshots:Download
- Screenshots:RecordEvent
- Screenshots:OverlaySelection
- Screenshots:ShowPanel
- Screenshots:HidePanel
Steps to reproduce:
1) Open a fresh profile in Firefox Nightly
2) Load the attached test case
Actual results:
The attached test case can observe these events.
The attached test case is able to modify the user's clipboard and downloads folder.
Expected results:
The attached test case can't do that, ideally.
I found this issue while trying to figure out how to write an automated test for bug 1880634.
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 Screenshots component listens for custom events on a global object that is accessible to web content, without verifying the event's origin or restricting event dispatch to privileged code.
What the attacker needed
Firefox Nightly with Screenshots component; victim visits a malicious page
How it was found
- Open a fresh profile in Firefox Nightly.
- Load the attached test case (reduced.html).
- Observe that the test case can see the Screenshots events.
- Observe that the test case can modify the clipboard and downloads folder.
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 send and listen for special messages called events. Firefox's screenshot tool uses some of these events, and the report shows that a normal web page can also send them. This means a bad page could make the screenshot tool do things like copy data or save files without the user wanting it.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.