Skip to content
Access control Disclosed report Intermediate CVE-2017-5386

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.

Muneaki Nishimura Follow

Originally disclosed on Mozilla

  • Fixed in 39 days
  • Paid in 49 days
  • Disclosed after 39 days
Text
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.

The original report as published on Mozilla's Bugzilla, by Muneaki Nishimura. 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

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

  1. Install both the attacker and victim extensions in Firefox.
  2. 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.

More by Muneaki Nishimura

View all

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

Broken access control

The lesson behind this report.

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.