Improper initialization in Network (CVE-2026-78940)
KeepAliveURLLoader fails to clear redirect state when retrying a failed request, causing stale redirect data to be replayed to the renderer. This can lead to response.url spoofing, CSP path-matching bypass, and forged Attribution Reporting registrations.
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: KeepAliveURLLoader fails to clear its internal redirect state when retrying a request that failed after a redirect. This causes stale redirect data to be replayed to the renderer and used in browser-side security checks. Consequently, this can potentially lead to response.url spoofing in JavaScript, bypasses of path-based Content Security Policies (CSP), and forged Attribution Reporting registrations.
Affected files:
content/browser/loader/keep_alive_url_loader.cc
Estimated timestamp from git blame: 2026-02-10
Summary
There is a potential logic flaw in KeepAliveURLLoader where internal state related to redirects is not cleared when a request is retried. If a network request encounters a redirect and subsequently fails with a retriable error (e.g., net::ERR_NAME_NOT_RESOLVED), the loader attempts a retry. However, it retains the stale redirect history, which is then replayed to the renderer and used in browser-side checks, leading to several security impacts including response.url spoofing and CSP path-matching bypasses.
Note: The FetchRetry feature is currently behind an experimental Origin Trial, but a compromised or malicious renderer opting into the trial can trigger this browser-process logic.
Root Cause Analysis
When a request fails, KeepAliveURLLoader::MaybeScheduleRetry and subsequently AttemptRetryIfAllowed (in content/browser/loader/keep_alive_url_loader.cc) reset the request back to its original state using resource_request_ = original_resource_request_.
However, several redirect-related states are not cleared:
stored_url_load_->redirects: This queue stores intermediate redirects. It is appended to inEndReceiveRedirect. During a retry, it is never emptied, meaning redirects from the failed attempt persist.last_url_: This variable tracks the current URL in the redirect chain. It is not reset toinitial_url_on retry.attribution_request_helper_: The helper used for Attribution Reporting retains its updatedreporting_url_from the failed redirect.
Security Impacts
1. response.url Spoofing
When the retried request successfully completes, ForwardURLLoad() is called to send the response back to the renderer. Because the stored_url_load_->redirects queue is not empty, ForwardURLLoad() first replays the stale redirect to the renderer (forwarding_client_->OnReceiveRedirect). The renderer appends this spoofed URL to its internal url_list_. When the actual 200 OK response arrives, the Fetch API resolves response.url to the last entry in the url_list_ (the stale redirect target), while serving the attacker-controlled response body.
2. CSP Path-Matching Bypass
During the retry, if the new attempt encounters another redirect, KeepAliveURLLoader::WillFollowRedirect evaluates CSP. It determines if a redirect has already occurred by evaluating last_url_ != initial_url_. Because last_url_ retains the stale value from the first attempt, this evaluates to true. Per CSP rules, if a redirect has occurred, path-matching is relaxed to origin-only matching (has_followed_redirect = true in SourceAllowPath). This potentially bypasses connect-src path restrictions.
3. Forged Attribution Reporting
The KeepAliveAttributionRequestHelper processes the successful response's headers using its internal reporting_url_. Because this was updated during the first failed redirect and not reset, it incorrectly attributes the response to the forged target URL of the stale redirect.
Potential Reproduction Steps
These are suggested steps to trigger the vulnerability from an attacker-controlled origin:
- An attacker sets up a server (
attacker.com) that has theFetchRetryOrigin Trial enabled. - The attacker executes JavaScript to trigger a fetch:
fetch('https://attacker.com/start', { keepalive: true, retryOptions: { maxAttempts: 2 } }); - The attacker's server responds to the first request with an HTTP 302 Redirect to a target URL (e.g.,
https://nonexistent.victim.example/). - The browser follows the redirect, updates
last_url_, and queues the redirect internally. - The connection to the nonexistent domain fails with
ERR_NAME_NOT_RESOLVED. - The browser initiates a retry because the error is retriable.
- On the second attempt, the attacker's server responds with an HTTP 200 OK and an attacker-controlled payload.
- The browser replays the stale redirect to the renderer followed by the 200 OK response. The JavaScript promise resolves with
response.urlincorrectly showinghttps://nonexistent.victim.example/.
Suggested Fix
When a retry is initiated (e.g., inside KeepAliveURLLoader::AttemptRetryIfAllowed or MaybeScheduleRetry), explicitly reset all state associated with the previous failed attempt. This includes:
- Clearing the
stored_url_load_->redirectsqueue. - Resetting
last_url_toinitial_url_. - Resetting
did_encounter_redirect_tofalse(or carefully reconsidering if it should remain cumulative depending on the intended design). - Resetting or re-initializing
attribution_request_helper_.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
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 retry logic resets the request but fails to clear redirect-related state such as the redirect queue, last URL, and attribution helper.
Impact
This could allow response.url spoofing, bypass of path-based CSP, and forged Attribution Reporting registrations, but only if the FetchRetry feature is enabled via Origin Trial.
What the attacker needed
FetchRetry Origin Trial enabled; attacker-controlled server; victim uses a browser with the trial
The fix
The retry logic should explicitly reset all redirect-related state, including the redirect queue, last URL, and attribution helper.
How it was found
- Attacker sets up a server with the FetchRetry Origin Trial enabled.
- Attacker executes JavaScript to trigger a keepalive fetch with retry options.
- Attacker's server responds with a 302 redirect to a nonexistent domain.
- The browser follows the redirect and queues it internally.
- The connection fails with ERR_NAME_NOT_RESOLVED, triggering a retry.
- On retry, the attacker's server responds with 200 OK and a payload; the browser replays the stale redirect, causing response.url to show the nonexistent domain.
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 request is retried after a failure, the browser component responsible for keepalive requests does not reset information about any redirects that happened before the failure. This leftover data is then sent to the web page, making it believe the final response came from a different address than it actually did, which can trick security checks.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.