Skip to content
Access control Disclosed report Advanced CVE-2026-16382

PSharedWorker SystemPrincipal escalation via page-icon:

A compromised content process could send a PSharedWorker IPC message with a forged SystemPrincipalInfo, and the parent process accepted it without checking it against the sender. Combined with attacker-seeded SVG favicon bytes served via page-icon:, this let the attacker run a privileged worker in the parent process with access to ChromeUtils, IOUtils and profile writes.

Yaqoub Aldurayhim Follow

Originally disclosed on Mozilla

  • Fixed in 24 days
  • Paid in 47 days
  • Disclosed after 24 days

Created attachment 9589099 poc.patch

Overview

A compromised ordinary content process can send a PBackground::PSharedWorker constructor with attacker-controlled RemoteWorkerData. The parent accepts the supplied PrincipalInfo without binding it to the sender process. If the content process supplies SystemPrincipalInfo, the parent derives a parent-process remote worker from that forged principal.

The second part of the chain uses page-icon:. A normal web page can seed Places with attacker-controlled SVG favicon bytes. page-icon: is registered as a UI/local resource, and classic top-level SharedWorker scripts do not require strict JavaScript MIME. The forged SystemPrincipal SharedWorker can therefore load the stored page-icon: bytes as its main worker script in the parent process.

I validated this against Firefox Nightly default test configuration. The PoC starts from an ordinary web content process and reaches privileged parent-process worker execution.

Build / Environment

Validated build:

Text
Firefox Nightly 153.0a1
Build ID: 20260523013911
Source stamp: 4addf98c4ca88d363eed3b9bf63cc7f467c9aa61
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0
Platform: Linux x86_64
Kernel: 6.17.0-23-generic
Test profile: fresh temporary profile from mach test
Attacker tab remoteType: webIsolated=https://example.org

Build configuration facts from the validation log:

Text
artifact: False
buildtype: opt
nightly_build: True
mozconfig.path: null

The PoC does not set enabling preferences. dom/workers/test/browser.toml only adds the support file and test entry. The test-only helper is used only to simulate compromised-content-process IPC; the PSharedWorker and page-icon: behavior under test is not enabled by a non-default preference.

Steps To Reproduce

  1. Apply poc.patch to a clean Firefox Nightly source checkout.
  2. Build Firefox with the default source-build configuration:
Bash
./mach build
  1. Run the PoC browser test:
Bash
./mach test --force dom/workers/test/browser_forged_system_sharedworker_poc.js
  1. Inspect the test log for the forged SharedWorker result line.

Actual Results

The attacker-controlled page starts in an ordinary web content process:

Text
PASS test_forged_system_principal_shared_worker - attacker starts in an ordinary web content process: webIsolated=https://example.org

The compromised-content-process IPC helper then forges a SystemPrincipal SharedWorker using page-icon: as the worker script URL. The parent process runs the attacker-controlled favicon bytes as a privileged worker script:

Text
INFO forged SharedWorker result: location=page-icon:https://example.org/browser/dom/workers/test/file_forged_system_sharedworker_favicon.html;origin=null;chromeUtils=object;components=undefined;ioUtils=object;pathUtils=object;resourceFetch=ok:200:true;moduleImport=ok:firefox;profileWrite=ok:true

The test completed successfully:

Text
TEST_END: Test PASS. Subtests passed 4/4. Unexpected 0
Overall Summary
Expected results: 5
Unexpected results: 0
OK

This shows:

  • ChromeUtils is available in the worker.
  • IOUtils and PathUtils are available.
  • The worker can fetch resource://gre/modules/AppConstants.sys.mjs.
  • The worker can import a privileged ES module.
  • The worker can write a file into the Firefox profile.

Expected Results

A content-process PSharedWorker constructor must not be able to supply SystemPrincipalInfo or otherwise cause a parent-process SystemPrincipal SharedWorker to be launched.

Expected behavior would be one of:

  • reject/fail the IPC when an other-process PSharedWorker supplies SystemPrincipalInfo;
  • validate RemoteWorkerData principals against the sender's real process/window/client principal;
  • ensure parent-process SystemPrincipal worker selection cannot be reached from an untrusted content process.

Additionally, attacker-controlled page-icon: favicon bytes should not become a privileged classic worker script merely because the forged loading principal is SystemPrincipal.

The original report as published on Mozilla's Bugzilla, by Yaqoub Aldurayhim. 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 parent process trusted the PrincipalInfo supplied in the PSharedWorker IPC message without validating it against the sender's real process or window principal, and page-icon: was treated as a privileged local resource that could serve as a classic worker script.

Impact

A compromised content process could escalate to privileged parent-process code execution, gaining access to ChromeUtils, IOUtils, PathUtils, privileged module imports and the ability to write files into the Firefox profile; the PoC relies on a test-only helper to simulate the compromised process.

What the attacker needed

Compromised content process; ability to seed a favicon via a web page; Firefox Nightly build

The fix

The IPC should reject SystemPrincipalInfo from an other-process sender and validate RemoteWorkerData principals against the sender's real principal, and attacker-controlled page-icon: bytes should not become a privileged worker script.

How it was found

  1. Apply the provided patch to a clean Firefox Nightly source checkout.
  2. Build Firefox with the default source-build configuration.
  3. Run the PoC browser test for the forged SystemPrincipal SharedWorker.
  4. Inspect the test log for the forged SharedWorker result line.

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.

Firefox splits web pages into sandboxed 'content' processes and a trusted 'parent' process. A page that manages to break out of its sandbox could ask the parent to start a background worker (a script that runs off the main page) and lie about who it is, claiming to be the browser itself. The parent believed the claim and ran attacker-supplied bytes as a trusted script, which is a serious sandbox escape.

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 Yaqoub Aldurayhim

View all

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