Insufficient validation of untrusted input in DataTransfer (CVE-2026-8516)
A malicious subframe inside a privileged page could bypass process isolation and steal local files through HTML5 drag-and-drop. The browser failed to validate drag metadata and used the main frame's privileges for download checks, letting the subframe read a local file.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 48 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A malicious subframe embedded in a privileged page can bypass process isolation to steal local files via HTML5 drag-and-drop. This occurs due to missing IPC validation of download_metadata in StartDragging and frame confusion in DragDownloadFile, which incorrectly evaluates download permissions using the primary main frame's privileges.
Affected files:
content/browser/renderer_host/render_widget_host_impl.cccontent/browser/download/drag_download_file.cc
Estimated timestamp from git blame: 2026-01-23
Summary
A potential security gap exists in the handling of drag-and-drop operations, allowing an unprivileged subframe to steal local files or access restricted URLs if embedded within a privileged main frame (such as a file:// page or an extension). The issue stems from a combination of missing IPC validation for drag metadata and a frame confusion bug where the browser uses the primary main frame's process ID for security checks instead of the actual IPC sender's process ID.
Technical Details
There are two interlinked flaws that make this attack possible:
- Missing IPC Validation in
StartDragging
In content/browser/renderer_host/render_widget_host_impl.cc, the StartDragging IPC handler converts blink::mojom::DragData into DropData. It performs ChildProcessSecurityPolicy checks and FilterURL filtering on various fields (like url_infos, filenames, and html_base_url). However, it completely fails to validate or apply FilterURL to drop_data.download_metadata. This allows a compromised or malicious renderer to pass highly privileged URLs (e.g., file:///C:/secret.txt) across the IPC boundary.
- Frame Confusion in
DragDownloadFile
When the drag operation converts the metadata into a download, a DragDownloadFile object is created (content/browser/download/drag_download_file.cc). Its constructor explicitly uses web_contents->GetPrimaryMainFrame() to determine the render_process_id and render_frame_id:
RenderFrameHost* host = web_contents->GetPrimaryMainFrame();
drag_ui_ = new DragDownloadFileUI(
url, referrer, referrer_encoding, initiator_origin,
host->GetProcess()->GetDeprecatedID(), host->GetRoutingID(),
...);
When the drop triggers the download, DownloadManagerImpl::BeginDownloadInternal evaluates the request's safety via DownloadRequestUtils::IsURLSafe. Because DragDownloadFile provided the primary main frame's process ID, ChildProcessSecurityPolicy::CanRequestURL evaluates the file access against the main frame's permissions. If the main frame is a file:// document, the check passes, and the browser copies the local file to a temporary drag directory.
When the drop completes over the attacker's subframe, the browser explicitly grants the subframe read access to this temporary file (via GrantFileAccessFromDropData), and the file is passed to the attacker's JavaScript via event.dataTransfer.files.
Suggested Attacker Steps
Note: These are potential steps as this was discovered by an LLM agent without a live execution environment.
- An attacker convinces a user to save an HTML file locally and open it (running in the
file://context). This file embeds the attacker's remote page as aniframe. - The attacker's subframe contains a draggable element with a
dragstartevent listener. - When the user drags the element, the attacker's JavaScript executes:
event.dataTransfer.setData("DownloadURL", "text/plain:secret.txt:file:///C:/target_secret.txt"); - The user completes the drag by dropping the item back onto the attacker's subframe.
- The browser initiates a download using the main frame's privileged context, copying the restricted local file to a temporary directory.
- The browser passes the temporary file to the subframe's
dropevent. - The attacker reads the file contents via the standard HTML5 File API (
await event.dataTransfer.files[0].text();) and exfiltrates it.
Suggested Fix
- Validate Metadata IPC: In
RenderWidgetHostImpl::StartDragging, parse thedrop_data.download_metadataURL and applyGetProcess()->FilterURL()to it, discarding the metadata if the initiating process lacks the required permissions. - Fix Frame Confusion: Modify
DragDownloadFileto accept the actual initiatingRenderFrameHost(or its IDs) rather than hardcodingweb_contents->GetPrimaryMainFrame(). Note that there is already aTODO(crbug.com/40470366)inDragDownloadFileUI::InitiateDownloadacknowledging this exact requirement.
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.
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 browser did not validate the download metadata URL in the drag IPC message and used the primary main frame's process ID for security checks instead of the actual sender's.
Impact
An attacker could steal local files or access restricted URLs if the victim opens a malicious local HTML file and performs a drag-and-drop action.
What the attacker needed
Victim opens a local HTML file; victim drags and drops an element; attacker controls a subframe
The fix
The browser should validate the download metadata URL in the drag IPC handler and use the actual initiating frame's process ID for security checks instead of the primary main frame's.
How it was found
- The attacker convinces a user to open a local HTML file that embeds the attacker's page as an iframe.
- The attacker's subframe has a draggable element with a dragstart listener.
- When the user drags, the attacker's JavaScript sets download metadata pointing to a local file.
- The user drops the item back onto the attacker's subframe.
- The browser downloads the local file using the main frame's privileges and passes it to the subframe.
- The attacker reads the file contents via the File API and exfiltrates it.
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.
Web pages can contain smaller pages called subframes. Normally a subframe from an untrusted site should not be able to read files on your computer. Here, because the outer page was trusted (like a local file), the browser wrongly let the subframe drag a local file into itself and read it.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.