Race condition in Workers (CVE-2026-79267)
A dedicated worker can outlive the document that created it, and because the browser reuses the same frame host identifier across same-site navigations, the worker's later capability requests are checked against the new document's permissions. This could let a compromised renderer obtain WebUSB, Direct Sockets, or network context access that the original document was not allowed to have.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: DedicatedWorkerHost performs live lookups of its ancestor RenderFrameHost using a GlobalRenderFrameHostId. Because RenderFrameHosts can be reused across same-site navigations, a worker from a previous document can inadvertently access capabilities or network contexts belonging to a newly navigated document.
Affected files:
content/browser/worker_host/dedicated_worker_host.cccontent/browser/worker_host/dedicated_worker_host.h
Estimated timestamp from git blame: 2024-09-18
Conclusion: A Time-of-Check Time-of-Use (TOCTOU) vulnerability exists in DedicatedWorkerHost, enabling Cross-Origin/Same-Origin Policy bypasses via cross-document capability delegation.
Analysis:
Initial logic and architecture parameters are validated: DedicatedWorkerHost retains a GlobalRenderFrameHostId (ancestor_render_frame_host_id_) to its creator frame. It performs live lookups via RenderFrameHostImpl::FromID() to authorize capabilities like WebUSB, Direct Sockets, or subresource loading. RenderFrameHosts (RFHs) are frequently reused across same-site navigations, meaning the ID remains constant while the underlying Document, Origin, and PermissionsPolicy fundamentally change.
The vulnerability manifests during this RFH reuse. If a dedicated worker outlives its creating document (e.g., via a compromised renderer delaying Mojo pipe teardown, or an IPC race condition), subsequent capability requests are evaluated against the new document's state.
Potential Attack Steps (Theoretical): Note: These are suggested steps; our tooling agent does not run code to provide a working PoC.
- A compromised renderer loads Document A (e.g.,
https://a.example.com,Permissions-Policy: usb=()) in an iframe and spawns a DedicatedWorker. - The renderer initiates a same-site navigation in the iframe to Document B (e.g.,
https://b.example.com,Permissions-Policy: usb=*). - The browser reuses the existing
RenderFrameHost, updating its policy and origin to Document B. Document A'sDocumentUserDatais destroyed, but the browser does not actively terminate theDedicatedWorkerHostas the renderer intentionally holds the Mojo pipe open. - The worker from Document A sends an IPC requesting
WebUsbService(or triggers a network factory rebuild via a simulated NetworkService crash). DedicatedWorkerHost::CreateWebUsbServicelooks up the RFH ID, retrieves Document B's RFH, and validates the request against Document B's permissive policy.- The browser incorrectly grants WebUSB access (or Document B's network context/cookies) to Document A's worker.
Impacted Functions:
DedicatedWorkerHost::CreateWebUsbServiceDedicatedWorkerHost::CreateWebSocketConnectorDedicatedWorkerHost::CreateDirectSocketsServiceDedicatedWorkerHost::CreateNetworkFactoryForSubresources(leaksIsolationInfoand cookie overrides)
Suggested Fix:
Modify DedicatedWorkerHost to store a blink::DocumentToken alongside the GlobalRenderFrameHostId at creation. During live lookups, verify that ancestor_render_frame_host->GetDocumentToken() matches the stored token. If they differ, the capability request must be safely aborted.
Evaluated with Chrome root at commit: 4859e669de60239572397b559c17dfab074511e9
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
Likely the worker stores only a reusable frame identifier and looks up the current frame at request time, without checking that the frame still hosts the same document that created the worker.
Impact
A compromised renderer could obtain WebUSB, Direct Sockets, or network context and cookie access that the original document was not permitted to use, bypassing cross-origin policy; the report notes these steps are theoretical and no working proof of concept was run.
What the attacker needed
Compromised renderer; same-site navigation; worker outlives its document
The fix
The worker should store a document token at creation and, on each capability request, verify that the current frame's document token matches the stored one, aborting the request if they differ.
How it was found
- A compromised renderer loads a document with restrictive permissions in an iframe and starts a dedicated worker.
- The renderer navigates the iframe to a same-site document with permissive permissions.
- The browser reuses the frame host and updates its policy, but the worker is kept alive because the renderer holds the communication pipe open.
- The worker sends a request for a capability such as WebUSB.
- The browser looks up the reused frame host and validates the request against the new document's permissive policy.
- The browser grants the capability to the worker from the old document.
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 web worker is a background script tied to a page. When you navigate to another page on the same site, the browser often reuses the same internal frame object, so an identifier stays the same even though the page and its permissions have changed. If the old worker is still alive, it can ask for powerful features and the browser may check the new page's permissions instead of the old one's, granting access it should not.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.