Incorrect authorization in ServiceWorker (CVE-2026-113211)
A logic flaw in the browser's Service Worker IPC handler allows a compromised, CSP-sandboxed renderer to register a Service Worker for its precursor origin. This bypasses Site Isolation and CSP restrictions, granting an attacker persistent control over the precursor origin.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the security team.
Overview: A logic flaw in the browser's Service Worker IPC handler potentially allows a compromised, CSP-sandboxed renderer to register a Service Worker for its precursor origin. The registration process relies on a StorageKey derived from the navigation URL rather than the document's true opaque origin. This bypasses Site Isolation and CSP restrictions, granting an attacker persistent control over the precursor origin.
Affected files:
content/browser/service_worker/service_worker_container_host.cccontent/browser/service_worker/service_worker_client.cccontent/browser/service_worker/service_worker_context_core.cc
Estimated timestamp from git blame: 2025-02-07
Description
There is a potential Site Isolation and CSP sandbox bypass in the Service Worker registration flow. When a document is loaded in an iframe with Content-Security-Policy: sandbox (lacking allow-same-origin), it is assigned an opaque origin. However, the browser-side Mojo IPC handler for Service Worker registration fails to account for this opacity, allowing a compromised sandboxed renderer to register a Service Worker for the non-opaque precursor origin.
The root cause lies in how ServiceWorkerContainerHostForClient::Register (in content/browser/service_worker/service_worker_container_host.cc) validates the registration request:
- It performs URL matching using
url_for_access_check()andservice_worker_security_utils::AllOriginsMatchAndCanAccessServiceWorkers. The latter compares origins usingDeprecatedGetOriginAsURL(). This strictly derives the origin from the URL string, ignoring the frame's opaque sandboxed state. - It retrieves the registration key via
service_worker_client().key(). ThisStorageKeyis initialized early during the request phase viaServiceWorkerClient::CalculateStorageKeyForUpdateUrls. Because it is initialized usingurl::Origin::Create(url)before the final sandbox flags are applied at commit, it results in a non-opaqueStorageKeythat matches the precursor origin. - The final validation step in
ServiceWorkerContextCore::IsValidRegisterRequestexplicitly checksif (key.origin().opaque()), but this check is bypassed because the erroneously constructedStorageKeyis not opaque.
Furthermore, there are no ChildProcessSecurityPolicy origin access checks applied during the Register IPC handling that would prevent the isolated, sandboxed renderer process from acting on behalf of the precursor origin.
Potential Exploitation Steps
(Note: Our tooling agent does not yet have the ability to run code to provide a working PoC, so these are suggested steps based on static analysis.)
- An attacker targets a site (
https://site.example) that embeds untrusted content inside an iframe protected byContent-Security-Policy: sandbox(withoutallow-same-origin). - The attacker gains Remote Code Execution (RCE) within the isolated renderer process hosting this sandboxed iframe.
- Bypassing Blink's standard JS API protections, the compromised renderer directly sends a
blink::mojom::ServiceWorkerContainerHost::RegisterMojo message to the browser process, specifying ascript_urlofhttps://site.example/sw.jsand ascopeofhttps://site.example/. - The browser process validates the request using the URL-derived
StorageKeyrather than the true opaque origin, passing all security checks. - The Service Worker is successfully registered. The attacker can now intercept and modify all future network traffic for the precursor origin
https://site.example.
Suggested Fix
Ensure that the StorageKey held by the ServiceWorkerClient is correctly updated during navigation commit to reflect the frame's true opaque origin when CSP sandbox flags apply.
Alternatively, explicitly enforce policy_container_policies_.sandbox_flags within ServiceWorkerContainerHostForClient::Register, or verify that the calling renderer process has the right to access the precursor origin via ChildProcessSecurityPolicy::GetInstance()->CanAccessOrigin() before proceeding with the registration.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
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 browser derives the StorageKey from the navigation URL before sandbox flags are applied, so the opaque origin check is bypassed.
Impact
A compromised sandboxed renderer could register a Service Worker for the precursor origin, bypassing Site Isolation and CSP to persistently intercept and modify network traffic.
What the attacker needed
Victim visits a site with a sandboxed iframe; attacker has RCE in the renderer; CSP sandbox without allow-same-origin
The fix
The StorageKey should be updated during navigation commit to reflect the true opaque origin when CSP sandbox flags apply, or the Register handler should enforce sandbox flags or perform a ChildProcessSecurityPolicy origin access check.
How it was found
- An attacker targets a site that embeds untrusted content in a sandboxed iframe.
- The attacker gains RCE in the isolated renderer hosting the sandboxed iframe.
- The compromised renderer sends a Service Worker registration message to the browser process.
- The browser validates the request using the URL-derived StorageKey instead of the true opaque origin.
- The Service Worker is registered, allowing the attacker to intercept and modify network traffic for the precursor origin.
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 Service Worker is a script that runs in the background and can intercept network requests. The browser is supposed to stop a sandboxed page from registering one for a different site, but a mistake in how it checks the page's origin lets a compromised page do it anyway.
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.