Insufficient validation of untrusted input in CORS (CVE-2026-7968)
The Network Service did not validate the cors_preflight_policy field in requests from untrusted renderers, so a compromised renderer could set it to skip CORS preflight checks. This allowed credentialed cross-origin requests with non-simple methods or headers, exposing servers to CSRF attacks.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 38 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A compromised renderer can bypass Out-of-Renderer CORS (OOR-CORS) preflights by manipulating the cors_preflight_policy Mojo field. This allows attackers to send credentialed cross-origin requests with non-simple methods (e.g., DELETE) or headers without the mandatory OPTIONS preflight. This exposes cross-origin servers to state-changing CSRF attacks.
Affected files:
services/network/cors/cors_url_loader.ccservices/network/cors/cors_url_loader_factory.ccservices/network/public/mojom/url_request.mojom
Estimated timestamp from git blame: 2026-02-01
Description
There is a potential Out-of-Renderer CORS (OOR-CORS) bypass caused by missing validation of the cors_preflight_policy field when receiving a ResourceRequest from an untrusted renderer process.
The network::mojom::URLRequest Mojo struct includes a cors_preflight_policy field. When an untrusted renderer sends a request via URLLoaderFactory::CreateLoaderAndStart, the Network Service evaluates the request using CorsURLLoaderFactory::IsValidRequest() (in services/network/cors/cors_url_loader_factory.cc). While this function performs extensive validation on fields like load_flags and request_initiator, it completely ignores cors_preflight_policy.
Because this field is not sanitized, a compromised renderer can set it to mojom::CorsPreflightPolicy::kPreventPreflight. Later, when CorsURLLoader::NeedsPreflight() (in services/network/cors/cors_url_loader.cc) is called to determine if an OPTIONS preflight is necessary, it explicitly checks this field:
std::optional<PreflightRequiredReason> NeedsPreflight(
const ResourceRequest& request) {
// ...
if (request.cors_preflight_policy ==
mojom::CorsPreflightPolicy::kPreventPreflight) {
return std::nullopt;
}
// ... checks for IsCorsSafelistedMethod and CorsUnsafeNotForbiddenRequestHeaderNames
}
Returning std::nullopt forces the Network Service to skip the preflight check entirely. This allows an attacker to send credentialed cross-origin requests with non-safelisted methods (e.g., DELETE, PUT) or custom headers without triggering the CORS preflight, leading to CSRF vulnerabilities against APIs that rely on CORS preflight enforcement.
Potential Steps to Trigger
Note: Our tooling agent cannot run code, so these are suggested theoretical steps to exploit the vulnerability.
- Compromise Renderer: An attacker compromises a renderer process, gaining the ability to craft raw Mojo messages.
- Craft Request: The attacker uses their Mojo access to construct a
network::mojom::URLRequesttargeting a cross-origin state-changing endpoint (e.g.,https://target.com/api/delete-account). - Set Non-Simple Attributes: The attacker sets the HTTP
methodtoDELETEand setscredentials_modetokIncludeto send the victim's ambient cookies. - Exploit the Policy Field: The attacker sets the
cors_preflight_policyfield tokPreventPreflight(enum value1). - Send the Request: The attacker sends the IPC via the
URLLoaderFactory::CreateLoaderAndStartendpoint provided to the renderer. - Bypass Preflight: The Network Service (
CorsURLLoaderFactory) accepts the request becauseIsValidRequestmisses this field.CorsURLLoaderseeskPreventPreflight, skips the OPTIONS request, and directly sends theDELETErequest with cookies to the target server. - CSRF Execution: The target server receives the
DELETErequest and processes it, assuming it was authorized by a successful preflight, resulting in a successful Cross-Site Request Forgery.
Suggested Fix
In CorsURLLoaderFactory::IsValidRequest() (services/network/cors/cors_url_loader_factory.cc), add a check to restrict cors_preflight_policy for untrusted callers. For example:
if (!is_trusted_) {
if (request.cors_preflight_policy != mojom::CorsPreflightPolicy::kConsiderPreflight) {
mojo::ReportBadMessage(
"CorsURLLoaderFactory: Untrusted caller attempting to bypass CORS preflight");
return false;
}
// ... existing checks ...
}
Alternatively, force the field to kConsiderPreflight for all requests originating from untrusted renderers.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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 function that validates requests from untrusted renderers did not check the cors_preflight_policy field, allowing a compromised renderer to set it to skip preflight.
Impact
A compromised renderer could send credentialed cross-origin requests with non-simple methods or headers without preflight, potentially leading to CSRF attacks against APIs that rely on CORS preflight enforcement.
What the attacker needed
Compromised renderer process; ability to craft raw Mojo messages
The fix
The fix should add a check in CorsURLLoaderFactory::IsValidRequest() to restrict cors_preflight_policy for untrusted callers, or force it to kConsiderPreflight for all requests from untrusted renderers.
How it was found
- Compromise a renderer process to gain the ability to craft raw Mojo messages.
- Construct a URLRequest targeting a cross-origin state-changing endpoint.
- Set the HTTP method to DELETE and credentials_mode to include cookies.
- Set the cors_preflight_policy field to kPreventPreflight.
- Send the request via the URLLoaderFactory::CreateLoaderAndStart endpoint.
- The Network Service accepts the request, skips the preflight, and sends the DELETE request with cookies, resulting in CSRF.
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 tries to send a request to a different site, the browser first asks that site for permission using a small check called a preflight. This report found that a malicious program inside the browser could skip that check and send dangerous requests, like deleting data, using the victim's logged-in cookies. That could let an attacker make changes on a website without the user's knowledge.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.