Insufficient data validation in DataTransfer (CVE-2026-11161)
A time-of-check to time-of-use flaw in Chromium's clipboard handling lets a malicious page bypass the clipboard snapshot cache and read updated OS clipboard content, such as a screenshot taken after the paste, without validation. An attacker could obtain sensitive clipboard data the user never intended to paste.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
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 Chrome Security team.
Overview: A potential Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in blink's clipboard handling. By bypassing the clipboard snapshot cache using a nested copy command, a malicious site could trick DataObjectItem::GetAsFile() into lazily reading and returning updated OS clipboard content (like a user's recent screenshot) without validation.
Affected files:
third_party/blink/renderer/core/clipboard/data_object_item.ccthird_party/blink/renderer/core/clipboard/system_clipboard.cccontent/browser/renderer_host/clipboard_host_impl.cc
Estimated timestamp from git blame: 2025-04-03
Description
There is a potential Time-of-Check to Time-of-Use (TOCTOU) vulnerability in how Chromium handles lazy reads of PNG data from the clipboard within the renderer process.
When a paste event is dispatched, a DataTransfer object is populated with DataObjectItems representing the clipboard content. Each item captures the clipboard's sequence_number_ at the time of creation. To prevent multiple synchronous IPCs and ensure consistency, ClipboardCommands::Paste uses a ScopedSystemClipboardSnapshot to cache clipboard reads during the event.
However, a malicious site can bypass this caching mechanism. If the site executes document.execCommand('copy') from within the paste event handler (which is allowed because the initial paste provides transient user activation), it triggers a write to the clipboard. The functions SystemClipboard::WriteDataObject() and CommitWrite() unconditionally call SystemClipboard::ResetSnapshot(), wiping out the protective cache.
If the script then stalls the main thread (e.g., using alert() or a busy loop) and the OS clipboard is updated externally during this delay (e.g., the user takes a screenshot), a subsequent call to DataTransferItem.getAsFile() will force a cache miss. DataObjectItem::GetAsFile() handles the PNG fetch by making a synchronous IPC to the browser process (system_clipboard_->ReadPng()). The browser process returns the current OS clipboard content.
Crucially, unlike DataObjectItem::GetAsString() which explicitly verifies that system_clipboard_->SequenceNumber() == sequence_number_ before returning data, DataObjectItem::GetAsFile() fails to perform any sequence number validation. Consequently, it potentially returns the newly copied data (like a sensitive screenshot) to the page, data the user never intended to paste.
Potential Attack Scenario
Note: These are potential steps as an automated agent has not run a working Proof of Concept.
- A user copies an innocuous image and pastes it into a malicious page (e.g., pressing Ctrl+V).
- The malicious page's
pasteevent listener executes and stores a reference to theimage/pngDataTransferItem. - The script registers a one-shot
copyevent listener that callsevent.preventDefault(). - The script executes
document.execCommand('copy'). This succeeds due to the transient user activation from the paste action, triggering the one-shot listener which prevents the default copy action but causesSystemClipboardto reset its snapshot cache. - The script stalls the renderer's main thread (e.g., by calling
alert('...')). - During the stall, the user takes a screenshot (updating the OS clipboard).
- The user dismisses the alert. The script resumes and calls
getAsFile()on the stored PNG item. - Due to the missing sequence number check and the wiped cache,
DataObjectItem::GetAsFile()performs a synchronous IPC, retrieves the new screenshot from the browser process, and returns it to the script.
Suggested Fix
Add a sequence number validation check in DataObjectItem::GetAsFile() for the kClipboardSource PNG path, mirroring the logic found in GetAsString():
// in third_party/blink/renderer/core/clipboard/data_object_item.cc
DCHECK_EQ(source_, DataSource::kClipboardSource);
+ if (system_clipboard_->SequenceNumber() != sequence_number_) {
+ return nullptr;
+ }
if (GetType() == ui::kMimeTypePng) {
mojo_base::BigBuffer png_data =
system_clipboard_->ReadPng(mojom::blink::ClipboardBuffer::kStandard);
// ...
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
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 PNG path in DataObjectItem::GetAsFile() does not check that the clipboard sequence number still matches the one captured when the item was created, unlike GetAsString().
Impact
A malicious page could read clipboard content, such as a screenshot, that the user copied after the initial paste, without the user's intent.
What the attacker needed
Victim pastes an image into a malicious page; user takes a screenshot during the stall; transient user activation from paste
The fix
Add a sequence number validation check in DataObjectItem::GetAsFile() for the clipboard PNG path, mirroring the logic in GetAsString().
How it was found
- A user copies an innocuous image and pastes it into a malicious page.
- The page's paste event listener stores a reference to the image/png DataTransferItem.
- The script registers a one-shot copy event listener that calls event.preventDefault().
- The script executes document.execCommand('copy'), which succeeds due to transient user activation and resets the clipboard snapshot cache.
- The script stalls the renderer's main thread, for example by calling alert().
- During the stall, the user takes a screenshot, updating the OS clipboard.
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 you paste something into a web page, the browser is supposed to give the page only the content that was on your clipboard at that moment. This report describes a way for a malicious page to make the browser re-read your clipboard later, after you have copied something new, and hand that new content to the page. The page can do this because it can trigger a copy action during the paste and then pause the browser while you take a screenshot.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.