Skip to content
Access control Disclosed report Intermediate

Some web extension API's do not account for shorthand form of file:// url

A shorthand form of a file:// URL bypassed the browser's protection that stops the tabs.create extension API from opening local files. An attacker with an installed extension holding the tabs permission could use this to detect which files and folders exist on the victim's disk.

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 23 months
  • Paid in 17 months
  • Disclosed after 23 months
Text
Created attachment 8939174
detect-file-PoC.zip

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

Steps to reproduce:

Using a shorthand(?) form of a file:// url seems to bypass the existing security that prevents tabs.create from opening locally stored files. 

The attached PoC uses this to detect locally stored files/folders (with the help of the 'tabs' permission). Just install it and modify 'background.js' with random files in your disk beforehand (especially if you're not on windows).


Actual results:

We can use the following to open file: urls:
browser.tabs.create({url:"\C:\\\\test.xml"});


Expected results:

"\C:\\\\test.xml" should be treated the same as "file://C:\\\\test.xml"

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.

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 URL validation only recognised the standard file:// prefix and did not normalise the shorthand form before deciding whether the URL pointed at a local file.

Impact

An installed extension with the tabs permission could detect the presence of local files and folders on the user's disk.

What the attacker needed

Victim installs a malicious extension; extension holds the tabs permission

How it was found

  1. Install the attached proof-of-concept extension.
  2. Edit its background script to list files you want to test for on disk.
  3. The extension calls the tabs.create API with a shorthand local file URL.
  4. Observe that the local file is opened, revealing whether it exists.

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.

Browsers normally stop extensions from quietly opening files on your computer, because that could reveal what you have stored. Here, a different way of writing a local file address slipped past that check. Someone who got you to install a malicious extension could then probe your disk to see which files exist.

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

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.