Confused deputy in Prerender (CVE-2026-87442)
A logic flaw in PrerendererImpl::MaybePrerender causes prefetches to be attributed to the primary main frame instead of the correct RenderFrameHost when the document is in the Back/Forward Cache. A compromised renderer can exploit this origin confusion to bypass cross-site prefetch isolation and issue credentialed GET requests, including SameSite=Strict cookies, to a victim site.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: PrerendererImpl::MaybePrerender can incorrectly attribute prefetches to the primary main frame instead of its own RenderFrameHost when the document is in the Back/Forward Cache. If triggered by a compromised renderer, this origin confusion allows an attacker to bypass cross-site prefetch isolation, potentially issuing credentialed GET requests (including SameSite=Strict cookies) to a victim site.
Affected files:
content/browser/preloading/prerenderer_impl.cccontent/browser/preloading/anchor_element_interaction_host_impl.cc
Estimated timestamp from git blame: 2024-10-10
Summary
A logic flaw exists in the prefetching implementation for speculation rules where PrerendererImpl incorrectly uses the primary main frame's context instead of the context associated with its own RenderFrameHost. When a page is moved to the Back/Forward Cache (BFCache), a compromised renderer can still trigger preloading actions via IPC. Due to this origin confusion, the browser misattributes the prefetch to the currently active page. This allows an attacker to bypass cross-site prefetch isolation and issue credentialed GET requests to the victim's site.
Prerequisite: The kPrerender2FallbackPrefetchSpecRules feature must be enabled.
Technical Details
When a prerender is triggered as a fallback for speculation rules, PrerendererImpl::MaybePrerender is called. In content/browser/preloading/prerenderer_impl.cc, the code retrieves a PrefetchDocumentManager to initiate a prefetch:
auto* prefetch_document_manager =
content::PrefetchDocumentManager::GetOrCreateForCurrentDocument(
web_contents->GetPrimaryMainFrame());
The use of web_contents->GetPrimaryMainFrame() is problematic. If the PrerendererImpl instance belongs to a RenderFrameHost that has been moved to the BFCache, GetPrimaryMainFrame() will return the current active main frame of the WebContents, which belongs to the newly navigated origin.
The attack path proceeds as follows:
- IPC Trigger: A compromised renderer for a BFCached Document A (
attacker.com) sends ablink.mojom.AnchorElementInteractionHost::OnPointerDownmessage for a URL on Document B (victim.com). - Missing Lifecycle Check:
AnchorElementInteractionHostImpl::OnPointerDownandPreloadingDeciderlack anIsActive()or!IsInLifecycleState(kInBackForwardCache)check, allowing the IPC to be processed. - Origin Confusion:
PrerendererImpl::MaybePrerender(associated with Document A) is called. It fetches thePrefetchDocumentManagerfor Document B (the current primary main frame). - Spoofed Request:
PrefetchRequest::CreateRendererInitiateduses Document B'srender_frame_host()as the initiator, setting thereferring_origin_tovictim.com. - Isolation Bypass: Because the
referring_origin_(victim.com) matches the target URL (victim.com/sensitive),PrefetchRequest::IsCrossSiteRequestreturnsfalse. - Credentialed Request: The browser treats the prefetch as same-site, bypassing the
kUserHasCookiesrejection logic inPrefetchService. It uses the default network context, attaching the user's cookies forvictim.com(includingSameSite=Strictcookies).
Impact
An attacker with a compromised renderer can potentially trigger blind, credentialed GET requests to arbitrary URLs on a victim's site. While the attacker cannot read the response, this can be used for CSRF-like attacks against sensitive state-changing GET endpoints. The bypass of SameSite=Strict and cross-site isolation significantly increases the severity of this issue.
Suggested Steps to Reproduce
Note: These are potential steps based on code analysis; our tooling cannot execute this exploit directly.
- Host a malicious page at
attacker.com(Document A). - From Document A, register a speculation rule (
action: "prerender") for a sensitive URL onvictim.com. - Navigate the tab from
attacker.comtovictim.com(Document B). Document A enters the BFCache. - Simulate a compromised renderer for Document A by sending a
blink.mojom.AnchorElementInteractionHost::OnPointerDownmessage for thevictim.comURL over its Mojo pipe. - Observe that a prefetch for the
victim.comURL is issued, using Document B's origin as the referrer, and that a credentialed GET request is sent tovictim.comwith Document B's cookies.
Proposed Fix
- Lifecycle Validation: Add
IsActive()checks toAnchorElementInteractionHostImplIPC handlers (similar toSpeculationHostImpl::ValidateFrameState) to drop preloading messages from inactive or BFCached frames. - Fix Origin Confusion: In
PrerendererImpl::MaybePrerender, retrieve thePrefetchDocumentManagerusing thePrerendererImpl's ownrender_frame_host_instead ofweb_contents->GetPrimaryMainFrame().C++ auto* prefetch_document_manager = content::PrefetchDocumentManager::GetOrCreateForCurrentDocument(&render_frame_host_.get());
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 code uses web_contents->GetPrimaryMainFrame() to get the PrefetchDocumentManager, which returns the active main frame instead of the frame associated with the PrerendererImpl, causing origin confusion when the frame is in BFCache.
Impact
An attacker with a compromised renderer can potentially trigger blind, credentialed GET requests to arbitrary URLs on a victim's site, bypassing SameSite=Strict and cross-site isolation, which could be used for CSRF-like attacks against sensitive state-changing GET endpoints.
What the attacker needed
Compromised renderer; [redacted] enabled; victim visits attacker page then victim site
The fix
The issue should be fixed by adding IsActive() checks to AnchorElementInteractionHostImpl IPC handlers and by retrieving the PrefetchDocumentManager using the PrerendererImpl's own render_frame_host_ instead of web_contents->GetPrimaryMainFrame().
How it was found
- Host a malicious page at attacker.com (Document A).
- From Document A, register a speculation rule (action: "prerender") for a sensitive URL on victim.com.
- Navigate the tab from attacker.com to victim.com (Document B). Document A enters the BFCache.
- Simulate a compromised renderer for Document A by sending a blink.mojom.AnchorElementInteractionHost::OnPointerDown message for the victim.com URL over its Mojo pipe.
- Observe that a prefetch for the victim.com URL is issued, using Document B's origin as the referrer, and that a credentialed GET request is sent to victim.com with Document B's cookies.
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 page is put into the browser's back/forward cache, it is kept in memory but not active. A security check in the browser's prefetching code mistakenly uses the active page's identity instead of the cached page's identity. This lets a malicious page, if it can run code in the browser, make requests to another site as if they came from that site, potentially with the user's cookies.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.