Skip to content
CORS Advisory Advanced CVE-2026-121161

Information leak in BackgroundFetch (CVE-2026-121161)

BackgroundFetch in Chrome hardcoded every stored response as the default response type, so Blink skipped the CORS header filtering it normally applies to cross-origin responses. An attacker page could therefore read non-exposed and forbidden response headers, such as Set-Cookie, from a cross-origin server that allowed its origin via CORS.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 7 months

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: BackgroundFetch hardcodes the response type to kDefault for all responses, including those from cross-origin requests. This causes Blink to skip the mandatory CORS header filtering, allowing a cross-origin requester to read response headers that were not explicitly exposed via Access-Control-Expose-Headers, as well as forbidden headers like Set-Cookie.

Affected files:

  • content/browser/background_fetch/storage/mark_request_complete_task.cc
  • content/browser/background_fetch/background_fetch_cross_origin_filter.cc
  • content/browser/background_fetch/background_fetch_request_info.cc
  • third_party/blink/renderer/core/fetch/response.cc
  • third_party/blink/renderer/modules/background_fetch/background_fetch_record.cc

Estimated timestamp from git blame: 2019-08-28

Background

In the Fetch standard, responses to cross-origin CORS requests are assigned a response type of cors. When such a response is exposed to JavaScript, it must be filtered so that only CORS-safelisted headers and headers listed in the Access-Control-Expose-Headers response header are visible to the requester. Responses with the default type (typically same-origin) are not subjected to this filtering, but still have forbidden headers like Set-Cookie stripped out (which is handled by kBasic).

Vulnerability Details

The BackgroundFetch implementation in Chrome fails to correctly categorize responses, incorrectly marking them all as kDefault.

In content/browser/background_fetch/storage/mark_request_complete_task.cc, the MarkRequestCompleteTask::StoreResponse method hardcodes the response type:

C++
void MarkRequestCompleteTask::StoreResponse(base::OnceClosure done_closure) {
  response_ = blink::mojom::FetchAPIResponse::New();
  response_->url_list = request_info_->GetURLChain();
  response_->response_type = network::mojom::FetchResponseType::kDefault; // <--- Hardcoded
  // ...
}

Additionally, BackgroundFetchCrossOriginFilter does not currently implement support for the Access-Control-Expose-Headers header, or any header filtering, as noted by TODO comments in content/browser/background_fetch/background_fetch_cross_origin_filter.cc. StoreResponse copies all headers from the response into response_->headers.

When a developer accesses the response via BackgroundFetchRecord.responseReady in JavaScript, the renderer process materializes a blink::Response object. Because the browser process provided kDefault as the response type, the filtering logic in third_party/blink/renderer/core/fetch/response.cc (FilterResponseDataInternal) returns the response unfiltered:

C++
    case network::mojom::FetchResponseType::kDefault:
      return response;

Consequently, all response headers become readable via response.headers.get(), even if they were not intended to be exposed cross-origin. Furthermore, because it's evaluated as kDefault instead of kBasic, forbidden headers like Set-Cookie are also exposed to JavaScript.

Impact

An attacker can use Background Fetch to download a resource from a cross-origin victim server that has opted into CORS (via Access-Control-Allow-Origin). The attacker can then read any sensitive supplementary headers (e.g., internal trace IDs, server information, rate-limiting headers, Set-Cookie session tokens) that would normally be filtered out by a standard fetch() call.

Note that this bypass only affects header visibility; the response body is only accessible if the victim server explicitly allowed the origin via Access-Control-Allow-Origin.

Suggested Reproduction Steps

Note: Fortify LLM agent doesn't yet have the ability to run code, so these are suggested steps.

  1. From https://attacker.example, initiate a Background Fetch to https://victim.example/api.
  2. Ensure https://victim.example/api returns Access-Control-Allow-Origin: https://attacker.example and includes a non-safelisted header (e.g., X-Internal-Secret: 123) or a Set-Cookie header without listing it in Access-Control-Expose-Headers.
  3. In the service worker, catch the backgroundfetchsuccess event.
  4. Access record.responseReady and observe that response.headers.get('x-internal-secret') returns '123' instead of null.
  5. Observe that response.type is incorrectly reported as 'default' instead of 'cors'.

Suggested Fix

MarkRequestCompleteTask::StoreResponse should determine the correct FetchResponseType based on the origin of the request and the response URL chain. For same-origin requests, it should be kBasic (which strips Set-Cookie), and for cross-origin CORS requests, it should be kCors. The response_type must be accurately passed via mojo so that Blink's FilterResponseDataInternal can properly apply CORS and forbidden header filtering.

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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 response type was hardcoded to the default value when storing BackgroundFetch responses, so Blink's filtering logic treated cross-origin responses as unfiltered.

Impact

An attacker could read sensitive supplementary headers, potentially including Set-Cookie session tokens, though the response body is only accessible if the victim server explicitly allowed the origin via CORS.

What the attacker needed

Victim server allows attacker origin via CORS; attacker page runs a service worker; victim returns non-exposed or Set-Cookie headers

The fix

The response type should be derived from the request and response URL chain, using kBasic for same-origin and kCors for cross-origin CORS requests, so Blink applies the correct filtering.

How it was found

  1. From an attacker origin, start a Background Fetch to a victim endpoint.
  2. The victim endpoint allows the attacker origin via CORS and returns a non-safelisted or Set-Cookie header not listed in Access-Control-Expose-Headers.
  3. In the service worker, handle the backgroundfetchsuccess event.
  4. Read record.responseReady and check that the hidden header value is returned instead of null.
  5. Note that response.type is reported as default rather than cors.

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 fetches data from another site, the browser normally hides most of the response headers unless that site explicitly allows them to be seen. Here Chrome's background download feature labelled every response as if it came from the same site, so the hiding step was skipped. A malicious page could then read headers it should never see, including session cookies.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.