Insufficient policy enforcement in ServiceWorker (CVE-2026-9116)
The Service Worker Static Routing API checked Cross-Origin Resource Policy (CORP) using the Service Worker's own Cross-Origin Embedder Policy (COEP) instead of the client page's COEP. This allowed a cross-origin isolated page to load opaque cross-origin responses without CORP headers, potentially enabling data leakage via Spectre side-channels.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: The Service Worker Static Routing API enforces CORP checks using the Service Worker's COEP instead of the client's COEP when fetching from the cache source. This allows a cross-origin isolated page to load opaque cross-origin responses that lack CORP headers, bypassing security boundaries.
Affected files:
content/browser/service_worker/service_worker_container_host.cccontent/browser/service_worker/service_worker_version.cccontent/renderer/service_worker/service_worker_subresource_loader.cccontent/browser/cache_storage/cache_storage_dispatcher_host.cc
Estimated timestamp from git blame: 2025-01-31
Description
A potential security vulnerability exists in the Service Worker Static Routing API. When a Service Worker registers a routing rule with source: 'cache', the CacheStorage Mojo interface is incorrectly bound using the Service Worker's own security policies (COEP and DIP) rather than the policies of the controlled client document.
This allows a cross-origin isolated page (COEP: require-corp) controlled by a Service Worker with a weaker policy (e.g., COEP: unsafe-none) to bypass Cross-Origin Resource Policy (CORP) checks. An attacker can cache an opaque cross-origin response without a CORP header, and then use the static routing API to load it into the cross-origin isolated renderer process, where it could be leaked using Spectre side-channels (leveraging SharedArrayBuffer and high-resolution timers).
Vulnerability Details
- When a navigation is committed for a controlled client,
ServiceWorkerContainerHostForClient::CreateControllerServiceWorkerInfo()is called. If the Service Worker has a static router evaluator, it callscontroller()->GetRemoteCacheStorage()to provide the renderer with direct access to the cache. - In
ServiceWorkerVersion::GetRemoteCacheStorage(), theCacheStoragereceiver is bound using the Service Worker's owncross_origin_embedder_policy()anddocument_isolation_policy(). The Mojo remote is then sent to the client renderer. - When the client renderer initiates a subresource fetch that matches a
source: 'cache'rule,ServiceWorkerSubresourceLoadercallsMatch()on the CacheStorage remote. - In the browser process,
CacheStorageDispatcherHost::CacheStorageImpl::Matchenforces CORP by callingResponseBlockedByCrossOriginResourcePolicy(). However, it uses the COEP that was bound to the receiver (the Service Worker'sunsafe-nonepolicy) instead of the client'srequire-corppolicy. - Consequently, the opaque cross-origin response is returned to the client renderer without being blocked by CORP, violating the security guarantees of the cross-origin isolated page.
Suggested Reproduction Steps
Note: These steps are suggested based on code analysis; a working proof of concept has not yet been executed.
- Create a Service Worker script served without a
Cross-Origin-Embedder-Policyheader (resulting inCOEP: unsafe-none). - In the Service Worker's
installevent, use the Service Worker Static Routing API to register a route matching a specific cross-origin URL pattern with asource: 'cache'rule (event.addRoutes([{ condition: { urlPattern: '...' }, source: 'cache' }])). - Populate the Service Worker's cache with an opaque cross-origin response from the target URL (e.g., using
cache.put()on ano-corsfetch). Ensure the target response lacks a CORP header. - Host a client page controlled by this Service Worker that is cross-origin isolated (served with
COEP: require-corpandCross-Origin-Opener-Policy: same-origin). - Navigate the browser to the client page.
- From the client page, initiate a
no-corsfetch for the target cross-origin URL. - The browser returns the opaque response from the cache because the CORP check is incorrectly evaluated against the Service Worker's
unsafe-nonepolicy. - The opaque response enters the cross-origin isolated renderer process, where its contents could be read via Spectre side-channels.
Suggested Fix
Ensure that the CacheStorage Mojo remote provided to the client for static routing is bound using the client's own COEP and DIP, rather than the Service Worker's policies. When ServiceWorkerContainerHostForClient prepares the controller info, it should request a cache storage remote specifically configured for the client's security context.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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
Likely, the CacheStorage Mojo interface was bound using the Service Worker's security policies instead of the client's policies, so CORP checks were evaluated against the wrong COEP.
Impact
The opaque response enters the cross-origin isolated renderer process, where its contents could be read via Spectre side-channels, potentially leaking cross-origin data.
What the attacker needed
Attacker controls a Service Worker; victim visits a cross-origin isolated page; target response lacks CORP header; Spectre-capable environment
The fix
The CacheStorage Mojo remote provided to the client for static routing should be bound using the client's own COEP and DIP, rather than the Service Worker's policies.
How it was found
- Create a Service Worker script served without a Cross-Origin-Embedder-Policy header.
- In the Service Worker's install event, register a static route with a source: 'cache' rule for a cross-origin URL pattern.
- Populate the Service Worker's cache with an opaque cross-origin response from the target URL that lacks a CORP header.
- Host a client page controlled by this Service Worker that is cross-origin isolated (COEP: require-corp and Cross-Origin-Opener-Policy: same-origin).
- Navigate the browser to the client page.
- From the client page, initiate a no-cors fetch for the target cross-origin URL; the browser returns the opaque response from the cache because the CORP check uses the Service Worker's unsafe-none policy.
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 cache resources. Cross-Origin Embedder Policy (COEP) and Cross-Origin Resource Policy (CORP) are security headers that control which resources a page can load. The bug meant that a page with strict security settings could load resources that should have been blocked, because the check used the wrong policy.
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.