Incorrect authorization in Workers (CVE-2026-87466)
A SharedWorker created through the Storage Access API can open a WebSocket connection that incorrectly includes SameSite=Strict and Lax cookies, because the browser process does not apply the cross-site cookie restriction flag during WebSocket initialisation. An attacker could use this to send authenticated cross-site requests or track users in a third-party context.
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. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the security team.
Overview: SharedWorkers created via the Storage Access API (SAA) can potentially bypass cross-site cookie restrictions when establishing WebSocket connections. The browser process fails to apply the DoesRequireCrossSiteRequestForCookies flag during WebSocket initialization, relying solely on an overridden first-party storage key. As a result, SameSite=Strict and Lax cookies are incorrectly attached to the WebSocket handshake, enabling potential CSRF and tracking in third-party contexts.
Affected files:
content/browser/worker_host/shared_worker_host.cccontent/browser/storage_access/storage_access_handle.ccservices/network/websocket_factory.ccnet/websockets/websocket_stream.cccontent/public/browser/shared_worker_instance.h
Estimated timestamp from git blame: 2026-04-06
Description
There is a potential vulnerability in how the browser handles WebSocket connections originating from SharedWorkers created via the Storage Access API (SAA). This flaw allows a third-party context to bypass SameSite=Strict and SameSite=Lax cookie protections.
When a SharedWorker is spawned through an SAA grant, it is assigned a first-party StorageKey override to provide unpartitioned storage access. However, because it is still logically embedded in a third-party context, the renderer explicitly sets its same_site_cookies parameter to kNone. This correctly causes SharedWorkerInstance::DoesRequireCrossSiteRequestForCookies() to evaluate to true in the browser process.
While standard subresource fetches correctly respect this flag (via URLLoaderFactoryParamsHelper), the WebSocket creation path ignores it. As a result, the WebSocket handshake is treated by the network service as a first-party request, and restricted SameSite cookies are incorrectly attached.
Root Cause Analysis
In content/browser/worker_host/shared_worker_host.cc, the CreateWebSocketConnector method derives the IsolationInfo for the WebSocket connection directly from the worker's storage key:
void SharedWorkerHost::CreateWebSocketConnector(
mojo::PendingReceiver<blink::mojom::WebSocketConnector> receiver) {
// ...
const blink::StorageKey& storage_key = GetWorkerStorageKey();
mojo::MakeSelfOwnedReceiver(
std::make_unique<WebSocketConnectorImpl>(
// ...
storage_key.origin(), storage_key.ToPartialNetIsolationInfo(),
// ...
Because an SAA worker uses a first-party storage key override, ToPartialNetIsolationInfo() returns an IsolationInfo with a first-party SiteForCookies. Since the initiator (derived from storage_key.origin()) also matches this first-party context, the network service (net::cookie_util::ComputeSameSiteContext) computes the context as SAME_SITE_STRICT.
The code fails to check instance_.DoesRequireCrossSiteRequestForCookies(), which would otherwise indicate that this worker is explicitly forbidden from sending SameSite=Strict/Lax cookies.
Potential Steps to Reproduce
Note: Our tooling agent does not have the ability to run code, so these are suggested steps outlining how an attacker would likely trigger this vulnerability based on static analysis.
- An attacker controls
https://tracker.com, which sets a protected cookie:Set-Cookie: session=secret; SameSite=Strict; Secure. - The attacker embeds an iframe to
https://tracker.com/embedinside a top-level page they control, such ashttps://news.com. - Within the
tracker.comiframe, the attacker executesdocument.requestStorageAccess({SharedWorker: true})to obtain an SAA grant. - The iframe uses the obtained handle to spawn a worker:
handle.SharedWorker('/saa-worker.js'). - Inside
/saa-worker.js, the attacker initiates a WebSocket connection:new WebSocket('wss://tracker.com/api'). - Because of the missing check, the WebSocket Upgrade request will incorrectly include the
session=secret(SameSite=Strict) cookie, bypassing the cross-site boundary.
Suggested Fix
In SharedWorkerHost::CreateWebSocketConnector, the IsolationInfo should be adjusted to clear the SiteForCookies if the worker requires cross-site cookie semantics. For example:
const blink::StorageKey& storage_key = GetWorkerStorageKey();
net::IsolationInfo isolation_info = storage_key.ToPartialNetIsolationInfo();
if (instance_.DoesRequireCrossSiteRequestForCookies()) {
isolation_info = net::IsolationInfo::Create(
isolation_info.request_type(), isolation_info.top_frame_origin(),
isolation_info.frame_origin(), net::SiteForCookies(),
isolation_info.nonce());
}
mojo::MakeSelfOwnedReceiver(
std::make_unique<WebSocketConnectorImpl>(
GlobalRenderFrameHostId(GetProcessHost()->GetID(),
IPC::mojom::kRoutingIdNone),
storage_key.origin(), isolation_info,
// ...
This mirrors the behavior enforced on standard fetch() subresource requests for SAA workers, ensuring that the network service will only attach SameSite=None cookies to the WebSocket handshake.
Evaluated with Chrome root at commit: 137d451a126685dd5010e6609db9f6d4a78d8234
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 WebSocket creation path derives the connection's isolation information directly from the worker's first-party storage key override and never checks the worker's cross-site cookie requirement flag.
Impact
An attacker could perform cross-site request forgery and tracking in a third-party context by having protected cookies attached to a WebSocket handshake.
What the attacker needed
Attacker controls a site with a protected cookie; victim visits attacker's top-level page; browser supports Storage Access API with SharedWorker
The fix
The isolation information for the WebSocket connection should be adjusted to clear the site-for-cookies when the worker requires cross-site cookie semantics, mirroring how standard fetch requests are handled.
How it was found
- An attacker controls a site that sets a protected SameSite=Strict cookie.
- The attacker embeds an iframe of that site inside a top-level page they control.
- Inside the iframe, the attacker requests storage access with SharedWorker support.
- The iframe uses the handle to spawn a SharedWorker.
- The worker opens a WebSocket connection to the attacker's site.
- The WebSocket handshake incorrectly includes the protected cookie.
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.
Cookies with SameSite=Strict or Lax are meant to be sent only when a request comes from the same site, which helps stop other websites from making authenticated requests on your behalf. This report says a special kind of background script (a SharedWorker) created through a browser feature called the Storage Access API can open a WebSocket connection, and the browser wrongly treats that connection as same-site, so it attaches those protected cookies. That could let another site act as you or track you.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.