Web Extension's data: scheme pages can be controlled by other extensions
A web extension could control pages with a data: scheme that belong to another extension, because data: documents inherit the opener's context. An attacker extension could read the victim extension's localStorage and display its secret content.
Originally disclosed on Mozilla
- Fixed in 39 days
- Paid in 49 days
- Disclosed after 39 days
Created attachment 8812756
poc.zip
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50
Steps to reproduce:
1) Install both "attacker" and "victim" extensions in the attachment to Firefox
2. Open the browser_action of "victim" and click a link "Click to Reproduce" in the page
Actual results:
You can see a message "victim is pwned by attacker" in the page and an alert is shown with the content of victim extension's localStorage, i.e., SECRET
This means that the the attacker's extensions can control other extension's pages with data: scheme.
The cause of this issue is below.
https://dxr.mozilla.org/mozilla-central/source/toolkit/modules/addons/MatchPattern.jsm#21
Here the data: scheme is whitelisted but data: documents in Firefox inherits opener's context.
Expected results:
The data: scheme pages in another extension should be controlled by other extensions.
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
The data: scheme was whitelisted in match patterns, but data: documents inherit the opener's context, so another extension's page can be controlled.
Impact
An attacker extension could read the victim extension's localStorage and show its secret content, meaning one extension can control another extension's data: pages.
What the attacker needed
Victim installs a malicious extension; victim opens the victim extension's page; victim clicks a link
How it was found
- Install both the attacker and victim extensions in Firefox.
- Open the victim extension's browser action and click the 'Click to Reproduce' link.
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.
Browser extensions can open special pages that start with data:. These pages were treated as if they belonged to the extension that opened them, not the extension that owns the page. So a malicious extension could open a victim extension's data: page and read its private storage.
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.