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.cccontent/browser/service_worker/service_worker_registry.cccontent/browser/service_worker/service_worker_client.ccchrome/common/extensions/manifest_handlers/settings_overrides_handler.ccchrome/browser/extensions/api/settings_overrides/settings_overrides_api.ccchrome/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
- Malicious Extension Installation: An attacker publishes a Chrome extension using the
chrome_settings_overridespermission to set a custom Default Search Engine (DSE). The manifest sets thesearch_urlto an attacker-controlled origin (e.g.,https://attacker.com/search?q={searchTerms}) and injects a victim origin into thealternate_urlslist (e.g.,https://victim.com/search?q={searchTerms}).ConvertSearchProviderdoes not strictly validate thatalternate_urlsmatch thesearch_urlorigin. - Attacker SW Initialization: The user navigates to the attacker's main search URL (
https://attacker.com/search?q=foo). Because it's the DSE,CreateSyntheticRegistrationis called. It hardcodesdata->registration_idtokSyntheticResponseServiceWorkerRegistrationId(which is-10). A new Service Worker registration scoped tohttps://attacker.comis created and stored in theServiceWorkerContextCore::live_registrations_map under ID-10. - Victim Navigation & ID Collision: The user navigates to the victim URL (
https://victim.com/search?q=bar). Because it's in the DSE'salternate_urls, it is deemed eligible for a synthetic response.CreateSyntheticRegistrationis called again and creates a victim-scoped data object, but reuses the exact same hardcoded ID (-10). - Retrieving the Wrong Registration:
ServiceWorkerRegistry::GetOrCreateRegistrationattempts to look up the ID-10. Becauselive_registrations_is a flat map across the entireStoragePartition, it finds and returns the existing registration scoped tohttps://attacker.com, completely ignoring the victim scope in the new registration data. - DCHECK Bypass and UXSS: The attacker's registration is passed to the victim's
ServiceWorkerClient. InServiceWorkerClient::AddMatchingRegistrationandServiceWorkerClient::SetControllerRegistration, the checks that verify the registration's scope matches the client's URL are implemented usingDCHECKs (DCHECK(blink::ServiceWorkerScopeMatches(...))andDCHECK(IsMatchingRegistration(...))). In Release builds, these checks are compiled out. The attacker's Service Worker is successfully set as the controller forhttps://victim.com, allowing the attacker to intercept requests and inject arbitrary JavaScript.
Code References
- Hardcoded ID:
content/browser/service_worker/service_worker_loader_helpers.ccinCreateSyntheticRegistrationusesblink::mojom::kSyntheticResponseServiceWorkerRegistrationId. - Cross-Origin Map Lookup:
content/browser/service_worker/service_worker_registry.ccinGetOrCreateRegistrationlooks upcontext_->GetLiveRegistration(data.registration_id)without validating the origin matches thedata.scope. - DCHECK-Only Validation:
content/browser/service_worker/service_worker_client.ccrelies on#if DCHECK_IS_ON()andDCHECKfor scope matching when adding a matching registration and setting the controller registration.
Suggested Fix
- Eliminate Hardcoded IDs: Synthetic responses should dynamically allocate unique registration IDs per origin/StorageKey, rather than using a globally hardcoded ID (
-10). - Enforce Strict Scope Checks: Convert the
DCHECKs inServiceWorkerClient::AddMatchingRegistrationandServiceWorkerClient::SetControllerRegistrationtoCHECKs (or add safe early-returns) to ensure a Service Worker can never become the controller for a mismatched scope, even in Release builds. - Validate Alternate URLs: In
SettingsOverridesAPI::RegisterSearchProvider(orConvertSearchProvider), validate that allalternate_urlsshare the same origin as the primarysearch_urlor 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.
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
- Install an extension that sets a default search engine whose alternate URLs point at a victim origin.
- Visit the attacker's search URL so a synthetic registration is created and stored under the shared ID.
- Visit the victim URL listed as an alternate URL, which triggers a second synthetic registration reusing the same ID.
- The registry lookup returns the existing attacker-scoped registration instead of creating a victim-scoped one.
- 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.