Skip to content
XSS Advisory Advanced CVE-2026-7958

Inappropriate implementation in ServiceWorker (CVE-2026-7958)

A synthetic Service Worker mechanism used a single hardcoded registration ID shared across all origins, and the scope checks that should have stopped a mismatch were only debug assertions. An attacker-controlled extension could therefore make its own Service Worker the controller of an arbitrary victim origin, intercepting requests and running script there.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 41 days

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A potential Universal Cross-Site Scripting (UXSS) vulnerability exists when the kServiceWorkerSyntheticResponse feature is enabled. An attacker-controlled extension can exploit a hardcoded Service Worker registration ID and missing Release-build scope validations to install a malicious Service Worker as the controller for arbitrary victim origins. This allows complete interception of the victim's network requests and arbitrary script execution.

Affected files:

  • content/browser/service_worker/service_worker_loader_helpers.cc
  • content/browser/service_worker/service_worker_registry.cc
  • content/browser/service_worker/service_worker_client.cc
  • chrome/common/extensions/manifest_handlers/settings_overrides_handler.cc
  • chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc
  • chrome/browser/chrome_content_browser_client.cc

Estimated timestamp from git blame: 2026-01-13

Description

There is a potential vulnerability in the Service Worker synthetic response mechanism (kServiceWorkerSyntheticResponse) that allows an attacker to hijack Service Worker registrations for arbitrary origins. By combining a lack of origin validation in the chrome_settings_overrides extension API with a hardcoded Service Worker ID and DCHECK-only scope validation, an attacker can achieve Universal Cross-Site Scripting (UXSS).

Note: These are suggested potential steps, as our setup does not currently have the ability to run code or functional exploits to verify them.

Potential Attack Scenario

  1. Malicious Extension Installation: An attacker publishes a Chrome extension using the chrome_settings_overrides permission to set a custom Default Search Engine (DSE). The manifest sets the search_url to an attacker-controlled origin (e.g., https://attacker.com/search?q={searchTerms}) and injects a victim origin into the alternate_urls list (e.g., https://victim.com/search?q={searchTerms}). ConvertSearchProvider does not strictly validate that alternate_urls match the search_url origin.
  2. Attacker SW Initialization: The user navigates to the attacker's main search URL (https://attacker.com/search?q=foo). Because it's the DSE, CreateSyntheticRegistration is called. It hardcodes data->registration_id to kSyntheticResponseServiceWorkerRegistrationId (which is -10). A new Service Worker registration scoped to https://attacker.com is created and stored in the ServiceWorkerContextCore::live_registrations_ map under ID -10.
  3. Victim Navigation & ID Collision: The user navigates to the victim URL (https://victim.com/search?q=bar). Because it's in the DSE's alternate_urls, it is deemed eligible for a synthetic response. CreateSyntheticRegistration is called again and creates a victim-scoped data object, but reuses the exact same hardcoded ID (-10).
  4. Retrieving the Wrong Registration: ServiceWorkerRegistry::GetOrCreateRegistration attempts to look up the ID -10. Because live_registrations_ is a flat map across the entire StoragePartition, it finds and returns the existing registration scoped to https://attacker.com, completely ignoring the victim scope in the new registration data.
  5. DCHECK Bypass and UXSS: The attacker's registration is passed to the victim's ServiceWorkerClient. In ServiceWorkerClient::AddMatchingRegistration and ServiceWorkerClient::SetControllerRegistration, the checks that verify the registration's scope matches the client's URL are implemented using DCHECKs (DCHECK(blink::ServiceWorkerScopeMatches(...)) and DCHECK(IsMatchingRegistration(...))). In Release builds, these checks are compiled out. The attacker's Service Worker is successfully set as the controller for https://victim.com, allowing the attacker to intercept requests and inject arbitrary JavaScript.

Code References

  • Hardcoded ID: content/browser/service_worker/service_worker_loader_helpers.cc in CreateSyntheticRegistration uses blink::mojom::kSyntheticResponseServiceWorkerRegistrationId.
  • Cross-Origin Map Lookup: content/browser/service_worker/service_worker_registry.cc in GetOrCreateRegistration looks up context_->GetLiveRegistration(data.registration_id) without validating the origin matches the data.scope.
  • DCHECK-Only Validation: content/browser/service_worker/service_worker_client.cc relies on #if DCHECK_IS_ON() and DCHECK for scope matching when adding a matching registration and setting the controller registration.

Suggested Fix

  1. Eliminate Hardcoded IDs: Synthetic responses should dynamically allocate unique registration IDs per origin/StorageKey, rather than using a globally hardcoded ID (-10).
  2. Enforce Strict Scope Checks: Convert the DCHECKs in ServiceWorkerClient::AddMatchingRegistration and ServiceWorkerClient::SetControllerRegistration to CHECKs (or add safe early-returns) to ensure a Service Worker can never become the controller for a mismatched scope, even in Release builds.
  3. Validate Alternate URLs: In SettingsOverridesAPI::RegisterSearchProvider (or ConvertSearchProvider), validate that all alternate_urls share the same origin as the primary search_url or the extension itself.

Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8


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. Please feel free to reach out to me if you have concerns or feedback.

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

Likely a globally hardcoded synthetic registration ID combined with scope validation implemented only as DCHECKs, so a registration created for one origin was reused for another in Release builds.

Impact

The attacker's worker could intercept the victim origin's network requests and inject arbitrary JavaScript, but the report notes the steps are unverified and depend on an experimental feature flag being enabled.

What the attacker needed

Victim installs a malicious extension; experimental feature flag enabled; victim visits attacker and victim URLs

The fix

The report suggests allocating unique registration IDs per origin, turning the debug-only scope checks into enforced checks, and validating that alternate search URLs share the primary URL's origin.

How it was found

  1. Install an extension that sets a default search engine whose alternate URLs point at a victim origin.
  2. Visit the attacker's search URL so a synthetic registration is created and stored under the shared ID.
  3. Visit the victim URL listed as an alternate URL, which triggers a second synthetic registration reusing the same ID.
  4. The registry lookup returns the existing attacker-scoped registration instead of creating a victim-scoped one.
  5. The attacker's worker is set as controller of the victim origin, enabling request interception and script injection.

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 a site registers in the browser to sit between the page and the network, so it can see and change requests. Normally it is tied to one site. Here the browser reused one internal identifier for every site, and the safety check that the worker belongs to the page was only active in debug builds, so a worker from one site could end up controlling another.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.