Race condition in WebProtect (CVE-2026-78991)
A race condition in Chrome's clipboard handling allows a compromised renderer to bypass Enterprise Data Loss Prevention (DLP) checks. An attacker can write benign data to the clipboard while a slow image read is occurring, priming a cache that subsequently allows the sensitive image data through uninspected.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 months
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. Please see go/chrome-ai-generated-security-bugs-faq for more information.
Overview: A race condition in Chrome's clipboard handling allows a compromised renderer to bypass Enterprise Data Loss Prevention (DLP) checks. An attacker can write benign data to the clipboard while a slow image read is occurring, priming a cache that subsequently allows the sensitive image data through uninspected.
Affected files:
chrome/browser/enterprise/data_protection/paste_allowed_request.cccontent/browser/renderer_host/clipboard_host_impl.cccontent/public/browser/clipboard_types.cc
Estimated timestamp from git blame: 2024-04-26
Summary
A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in Chrome's clipboard processing that can allow a compromised renderer to bypass Enterprise Data Loss Prevention (DLP) content analysis when reading images from the clipboard.
The issue stems from the fact that reading an image from the clipboard (e.g., via ReadPng) is an asynchronous operation that may involve slow background-thread encoding. However, the sequence number used to cache the DLP policy decision is fetched after this asynchronous work finishes. A malicious renderer can exploit this window to modify the clipboard content, triggering a fast, benign policy check that caches an "allowed" verdict. When the slow image encoding finally completes, it re-uses this newly cached "allowed" verdict, permitting the sensitive image data to be delivered without inspection.
Detailed Analysis
- Initiating a Slow Read: The user copies a confidential image (e.g., a bitmap) to the OS clipboard. The clipboard is currently at sequence number
S1. A compromised renderer callsnavigator.clipboard.read()or uses direct Mojo access to send aReadPngmessage to the browser. - Background Processing:
ClipboardHostImpl::ReadPnginitiates a read from the OS clipboard. On Windows (features::kNonBlockingOsClipboardReads) or standard Non-Backed clipboards, reading a bitmap and converting it to PNG format involves dispatching a time-consuming task to a backgroundbase::ThreadPool(ui/base/clipboard/clipboard_win.cc:814). The UI thread does not block and continues processing Mojo messages. - The Race (Writing Benign Data): While the background encoding task is running, the renderer sends a
WriteSmartPasteMarkermessage followed by aCommitWritemessage. UnlikeWriteText, these specific write methods do not trigger asynchronous policy checks and immediately commit to the clipboard (content/browser/renderer_host/clipboard_host_impl.cc:597). This updates the OS clipboard state and increments the global sequence number toS2. - Priming the Cache: The renderer immediately sends a
ReadTextmessage. Because the clipboard now only contains a smart paste marker,ExtractTextquickly returns an empty string. The browser proceeds to check DLP policies for this empty text by callingPasteIfPolicyAllowed(content/browser/renderer_host/clipboard_host_impl.cc:833). - Caching the Benign Verdict:
PasteIfPolicyAllowedcaptures the current OS sequence number, which is nowS2. It initiates an Enterprise Content Analysis request. The check concludes that an empty string is safe and callsPasteAllowedRequest::Complete(chrome/browser/enterprise/data_protection/paste_allowed_request.cc:153). This populates the cache inRequestsMapStoragewith an "allowed" entry for sequence numberS2containing empty data. - The Bypass: Eventually, the original background task encoding the confidential PNG completes. Execution resumes on the UI thread at
ClipboardHostImpl::OnReadPngWithText(content/browser/renderer_host/clipboard_host_impl.cc:401), which bundles the sensitive PNG data into aClipboardPasteDataobject. - Re-fetching the Sequence Number:
OnReadPngWithTextcallsPasteIfPolicyAllowed. Crucially, this function callsGetSequenceNumberagain. Since the clipboard hasn't changed since step 3, it receivesS2. - Data Merging:
PasteAllowedRequest::StartPasteAllowedRequestis called with the sensitive PNG data and the sequence numberS2. It finds the completed, "allowed" cache entry from step 5. Because the entry is marked complete, it skips the DLP scan and immediately callsrequest.InvokeCallback(...). - Delivery: Inside
InvokeCallback, the incoming sensitive data is merged with the cached data (data.Merge(data_)). Because the cached data consists of empty fields, theMergefunction (content/public/browser/clipboard_types.cc:41) leaves the sensitive PNG data intact. The callback delivers the confidential image directly to the attacker's renderer.
Impact
A compromised renderer or malicious web application with clipboard read permissions could reliably extract confidential images or other data types from the clipboard, bypassing active Enterprise DLP content analysis policies.
Suggested Fix
The root cause is that PasteIfPolicyAllowed retrieves the clipboard sequence number at the end of the read pipeline, rather than capturing the sequence number that was associated with the data when it was originally extracted from the OS clipboard.
The ui::Clipboard::ReadPng (and related async read functions) should be modified to return the sequence number that was current when the read began. This captured sequence number should then be passed down the callback chain to ClipboardHostImpl::OnReadPng -> ExtractText -> OnReadPngWithText -> PasteIfPolicyAllowed. This ensures the DLP cache key strictly matches the generation of the data being analyzed.
Evaluated with Chrome root at commit: 661452647ddb2827305122ff3273bd5dea403f09
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.
Raised in root component due to access or custom field issues on 1208119
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 DLP policy decision cache key uses the clipboard sequence number fetched after asynchronous image encoding completes, rather than the sequence number at the time the data was originally read.
Impact
A compromised renderer or malicious web application with clipboard read permissions could reliably extract confidential images or other data types from the clipboard, bypassing active Enterprise DLP content analysis policies.
What the attacker needed
Compromised renderer; clipboard read permissions; Enterprise DLP enabled
The fix
The fix should modify async read functions to return the sequence number at the start of the read and pass it through the callback chain so the DLP cache key matches the data generation.
How it was found
- User copies a confidential image to the clipboard.
- Compromised renderer sends a ReadPng message to the browser.
- While background encoding runs, renderer sends WriteSmartPasteMarker and CommitWrite to change clipboard content.
- Renderer sends ReadText, which quickly returns empty string and triggers a DLP check that caches an 'allowed' verdict for the new sequence number.
- Background encoding completes and the sensitive PNG data is bundled.
- PasteIfPolicyAllowed re-fetches the sequence number, finds the cached 'allowed' entry, and delivers the sensitive image without inspection.
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 copy something, Chrome checks if it's allowed to be pasted. This check can be tricked: while Chrome is slowly preparing an image, an attacker quickly writes harmless data, causing Chrome to remember 'this is safe'. Then the original sensitive image is delivered without being checked.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.