Incorrect authorization in Loader (CVE-2026-87508)
A logic error in WorkerFetchContext allows cross-origin subresource requests with embedded credentials if they match the worker's credentials, omitting a same-origin check present in FrameFetchContext. An attacker could potentially perform authenticated CSRF against services using Basic or Digest authentication.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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 Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic error in WorkerFetchContext allows cross-origin subresource requests with embedded credentials if they match the worker's credentials. This omits a critical same-origin check present in FrameFetchContext, potentially enabling authenticated CSRF attacks from workers. The issue affects dedicated, shared, and service workers.
Affected files:
third_party/blink/renderer/core/loader/worker_fetch_context.cc
Estimated timestamp from git blame: 2017-06-13
Summary
A potential vulnerability exists in the implementation of WorkerFetchContext::ShouldBlockFetchAsCredentialedSubresource that may allow an attacker to bypass the BlockCredentialedSubresources intervention. This intervention is intended to prevent CSRF attacks by blocking subresource requests that contain embedded credentials (e.g., https://user:[email protected]/).
While FrameFetchContext requires that a credentialed subresource request both have matching credentials AND be same-origin with the document, the worker implementation currently only checks if the credentials match the worker's URL, omitting the same-origin requirement. This could allow cross-origin importScripts() calls to carry embedded credentials to a victim server.
Root Cause Analysis
In third_party/blink/renderer/core/loader/worker_fetch_context.cc, the method ShouldBlockFetchAsCredentialedSubresource handles the check as follows:
// third_party/blink/renderer/core/loader/worker_fetch_context.cc:158
bool WorkerFetchContext::ShouldBlockFetchAsCredentialedSubresource(
const ResourceRequest& resource_request,
const KURL& url) const {
if ((!url.User().empty() || !url.Pass().empty()) &&
resource_request.GetRequestContext() !=
mojom::blink::RequestContextType::XML_HTTP_REQUEST) {
if (Url().User() != url.User() || Url().Pass() != url.Pass()) {
// ... blocking logic ...
return true;
}
}
return false; // Credentials match -> ALLOW, missing same-origin check
}
In contrast, the document-based implementation in third_party/blink/renderer/core/loader/frame_fetch_context.cc (lines 1241-1247) correctly enforces a same-origin requirement:
if (Url().User() == url.User() && Url().Pass() == url.Pass() &&
SecurityOrigin::Create(url)->IsSameOriginWith(
GetResourceFetcherProperties()
.GetFetchClientSettingsObject()
.GetSecurityOrigin())) {
return false;
}
Because the worker context lacks the IsSameOriginWith check, a worker initialized with a credentialed URL (e.g., via a parent page navigation) can successfully issue authenticated requests to a cross-origin target that shares the same credentials.
Potential Impact
An attacker could potentially exploit this to perform authenticated CSRF against services using Basic or Digest authentication, such as routers, IoT devices, or internal enterprise applications. If an attacker can convince a user to navigate to https://admin:[email protected], they can spawn a worker that executes importScripts('https://admin:[email protected]/config/reboot'). The browser would then send an authenticated request to the local router, bypassing the intended security restrictions on credentialed subresources.
Potential Reproduction Steps
- Host a page at
http://attacker.example/index.htmlthat creates a worker:new Worker('worker.js');. - Host
http://attacker.example/worker.jswith:importScripts('http://admin:[email protected]/admin/reboot');. - Induce a user to navigate to
http://admin:[email protected]/index.html(the user may need to accept a browser navigation warning). - The worker is initialized with the URL
http://admin:[email protected]/worker.js. - The worker calls
importScripts().WorkerFetchContextobserves matching credentials (admin:admin) and allows the cross-origin request due to the missing origin check. - The browser retries the request to the target IP with a Basic Authentication header if challenged.
Suggested Fix
Update WorkerFetchContext::ShouldBlockFetchAsCredentialedSubresource to include a same-origin check similar to FrameFetchContext. The request should only be allowed if the credentials match AND the subresource URL is same-origin with the worker's security origin.
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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 fetch context only checks that the credentials in the subresource URL match the worker's credentials, but does not verify that the subresource is same-origin with the worker, unlike the frame fetch context.
Impact
An attacker could potentially perform authenticated CSRF against services using Basic or Digest authentication, such as routers, IoT devices, or internal enterprise applications.
What the attacker needed
Victim navigates to attacker page with credentials; victim may need to accept a navigation warning; target uses Basic or Digest authentication
The fix
The fix should update WorkerFetchContext::ShouldBlockFetchAsCredentialedSubresource to include a same-origin check similar to FrameFetchContext, allowing the request only if credentials match and the subresource URL is same-origin with the worker's security origin.
How it was found
- Host a page that creates a worker.
- Host the worker script that calls importScripts with a credentialed cross-origin URL.
- Induce a user to navigate to the attacker page with embedded credentials.
- The worker is initialized with the credentialed URL.
- The worker calls importScripts and the request is allowed because credentials match.
- The browser retries the request to the target with a Basic Authentication header if challenged.
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.
When a web page loads a script or other resource from another site, the browser sometimes includes a username and password in the request if the URL contains them. The browser has a safety rule to block such requests unless the resource is on the same site as the page, to stop attackers from making your browser send your credentials to other sites. This report says that rule is missing for background scripts called workers, so an attacker might trick your browser into sending credentials to a different site.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.