Skip to content
Access control Advisory Advanced CVE-2026-113211

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.cc
  • content/browser/service_worker/service_worker_client.cc
  • content/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:

  1. It performs URL matching using url_for_access_check() and service_worker_security_utils::AllOriginsMatchAndCanAccessServiceWorkers. The latter compares origins using DeprecatedGetOriginAsURL(). This strictly derives the origin from the URL string, ignoring the frame's opaque sandboxed state.
  2. It retrieves the registration key via service_worker_client().key(). This StorageKey is initialized early during the request phase via ServiceWorkerClient::CalculateStorageKeyForUpdateUrls. Because it is initialized using url::Origin::Create(url) before the final sandbox flags are applied at commit, it results in a non-opaque StorageKey that matches the precursor origin.
  3. The final validation step in ServiceWorkerContextCore::IsValidRegisterRequest explicitly checks if (key.origin().opaque()), but this check is bypassed because the erroneously constructed StorageKey is 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.)

  1. An attacker targets a site (https://site.example) that embeds untrusted content inside an iframe protected by Content-Security-Policy: sandbox (without allow-same-origin).
  2. The attacker gains Remote Code Execution (RCE) within the isolated renderer process hosting this sandboxed iframe.
  3. Bypassing Blink's standard JS API protections, the compromised renderer directly sends a blink::mojom::ServiceWorkerContainerHost::Register Mojo message to the browser process, specifying a script_url of https://site.example/sw.js and a scope of https://site.example/.
  4. The browser process validates the request using the URL-derived StorageKey rather than the true opaque origin, passing all security checks.
  5. 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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

  1. An attacker targets a site that embeds untrusted content in a sandboxed iframe.
  2. The attacker gains RCE in the isolated renderer hosting the sandboxed iframe.
  3. The compromised renderer sends a Service Worker registration message to the browser process.
  4. The browser validates the request using the URL-derived StorageKey instead of the true opaque origin.
  5. 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.

More from Google Chrome

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.