Incorrect authorization in Downloads (CVE-2026-87465)
A compromised renderer can set the is_context_menu_save flag in the DownloadURL IPC to bypass BackForwardCache activity checks and automatic download throttles, allowing an inactive frame to trigger a Save As dialog attributed to the visible tab. It also enables spoofing of Mark-of-the-Web referrer metadata.
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: A compromised renderer can bypass BackForwardCache (BFCache) activity checks and automatic download throttles by spoofing the is_context_menu_save flag in the DownloadURL IPC. This allows an inactive frame to trigger a Save As dialog attributed to the currently visible tab. It also enables spoofing of Mark-of-the-Web (MOTW) referrer metadata.
Affected files:
content/browser/download/download_manager_impl.cccontent/browser/renderer_host/render_frame_host_impl.cccontent/browser/renderer_host/ipc_utils.ccthird_party/blink/public/mojom/frame/frame.mojom
Estimated timestamp from git blame: 2024-12-10
Description
The DownloadURL IPC call in RenderFrameHostImpl handles download requests from the renderer. One of the parameters in blink::mojom::DownloadURLParams is is_context_menu_save, which is intended to indicate if the download was initiated via a user right-clicking and selecting 'Save Link As...'.
In RenderFrameHostImpl::DownloadURL, the content_initiated flag is calculated as !blink_parameters->is_context_menu_save. This flag is then passed to DownloadManagerImpl::BeginDownloadInternal.
In DownloadManagerImpl::BeginDownloadInternal, several critical security checks are gated behind the content_initiated flag:
if (rfh && content_initiated) {
if (rfh->IsInactiveAndDisallowActivation(
RenderFrameHost::InactiveCheckAllowedReason::kBeginDownload)) {
return;
}
// ... throttle checks ...
if (!delegate_->CheckDownloadAllowed(...)) {
return;
}
}
A compromised renderer can arbitrarily set is_context_menu_save to true, forcing content_initiated to be false. This results in the following security bypasses:
- BFCache Activity Gate Bypass: The call to
IsInactiveAndDisallowActivationis skipped. This allows aRenderFrameHostthat is currently in the BackForwardCache (and thus should be inactive) to successfully initiate a download. - Automatic Download Throttle Bypass: The
delegate_->CheckDownloadAllowedcall, which enforces automatic download throttles and user gesture requirements, is skipped. - UI Spoofing: Because the download is initiated from a BFCached frame while a new page is visible in the tab, the 'Save As' dialog (triggered because
promptis set totruewhenis_context_menu_saveis true) appears while the user is looking at a different origin. Thetab_urlfor the download is taken from the current visible entry, leading to incorrect attribution in the download UI. - Mark-of-the-Web (MOTW) Spoofing: The renderer-provided
referrerURL is not validated against the frame's origin inVerifyDownloadUrlParams. This unvalidated URL is eventually used to set the Mark-of-the-Web (MOTW)ReferrerUrlandHostUrlon Windows (e.g., viaBaseFile::GetEffectiveAuthorityURLfordata:URLs and thenquarantine::SetInternetZoneIdentifierDirectly), allowing an attacker to falsely attribute a malicious payload to a trusted site.
Potential Reproduction Steps (AI Suggested)
Note: These are suggested steps, as this AI agent does not have the ability to run code to verify them.
- Obtain renderer RCE in a process hosting
attacker.com. - Navigate a tab from
attacker.comto a trusted site likehttps://victim.com/. Theattacker.comRenderFrameHostenters the BFCache. - From the compromised
attacker.comrenderer process, craft ablink::mojom::DownloadURLParamsstruct. - Set
is_context_menu_save = true,urlto a malicious payload (e.g., adata:URI containing an executable), andreferrertohttps://victim.com/. - Send this struct to the browser process via the
blink::mojom::LocalFrameHost::DownloadURLIPC endpoint. - The browser will skip the BFCache check and prompt the user with a 'Save As' dialog while
victim.comis in the address bar. - Upon completion, the downloaded file's Mark-of-the-Web
Zone.Identifieron Windows will containReferrerUrl=https://victim.com/andHostUrl=https://victim.com/.
Suggested Fix
The browser process should not trust the is_context_menu_save flag from the renderer for critical security checks like BFCache gating and download throttling. Context menu saves are typically initiated by the browser process itself. If this IPC must be used for context menu saves, the browser process should independently verify that a valid context menu action recently occurred for that frame. Additionally, the referrer provided in DownloadURLParams should be validated against the requesting frame's origin in VerifyDownloadUrlParams to prevent MOTW spoofing.
Evaluated with Chrome root at commit: bb48272cafb7e24c93f55ef40da398cd206ee651
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.
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
The browser process trusted a renderer-supplied flag (is_context_menu_save) to decide whether to enforce security checks, and did not validate the referrer against the frame's origin.
Impact
An attacker with renderer compromise could bypass download throttles, show a misleading Save As dialog attributed to a trusted site, and spoof Mark-of-the-Web metadata on Windows.
What the attacker needed
Compromised renderer process; victim navigates to a trusted site; user interacts with Save As dialog
How it was found
- Obtain renderer RCE in a process hosting attacker.com.
- Navigate a tab from attacker.com to a trusted site so the attacker.com frame enters the BFCache.
- From the compromised renderer, craft a DownloadURLParams struct with is_context_menu_save set to true, a malicious data: URI, and a referrer pointing to the trusted site.
- Send the struct to the browser process via the DownloadURL IPC endpoint.
- The browser skips the BFCache check and shows a Save As dialog while the trusted site is in the address bar.
- The downloaded file's Mark-of-the-Web metadata contains the spoofed referrer and host URLs.
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.
A renderer is the part of a browser that turns web code into a page; if an attacker takes it over, they can send fake messages to the browser's core. Here, a flag meant to mark a user's right-click 'Save As' action was trusted, so the core skipped safety checks and showed a download prompt that looked like it came from a trusted site. This could trick someone into saving a malicious file under a trusted name.
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.