Skip to content
File upload Advisory Advanced CVE-2026-8516

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

Critical View original
  • 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.cc
  • content/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:

  1. 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.

  1. 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:

C++
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.

  1. 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 an iframe.
  2. The attacker's subframe contains a draggable element with a dragstart event listener.
  3. When the user drags the element, the attacker's JavaScript executes: event.dataTransfer.setData("DownloadURL", "text/plain:secret.txt:file:///C:/target_secret.txt");
  4. The user completes the drag by dropping the item back onto the attacker's subframe.
  5. The browser initiates a download using the main frame's privileged context, copying the restricted local file to a temporary directory.
  6. The browser passes the temporary file to the subframe's drop event.
  7. The attacker reads the file contents via the standard HTML5 File API (await event.dataTransfer.files[0].text();) and exfiltrates it.

Suggested Fix

  1. Validate Metadata IPC: In RenderWidgetHostImpl::StartDragging, parse the drop_data.download_metadata URL and apply GetProcess()->FilterURL() to it, discarding the metadata if the initiating process lacks the required permissions.
  2. Fix Frame Confusion: Modify DragDownloadFile to accept the actual initiating RenderFrameHost (or its IDs) rather than hardcoding web_contents->GetPrimaryMainFrame(). Note that there is already a TODO(crbug.com/40470366) in DragDownloadFileUI::InitiateDownload acknowledging 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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

  1. The attacker convinces a user to open a local HTML file that embeds the attacker's page as an iframe.
  2. The attacker's subframe has a draggable element with a dragstart listener.
  3. When the user drags, the attacker's JavaScript sets download metadata pointing to a local file.
  4. The user drops the item back onto the attacker's subframe.
  5. The browser downloads the local file using the main frame's privileges and passes it to the subframe.
  6. 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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.