Out of bounds read in DataTransfer (CVE-2026-93376)
Several Windows clipboard and drag-and-drop helper functions in Chrome treat externally supplied HGLOBAL buffers as null-terminated strings without checking their allocated size. A malicious local application could provide a buffer with no null terminator, causing Chrome to read past the allocation and leak adjacent browser-process heap memory to a web page.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential out-of-bounds heap read vulnerability exists in Google Chrome on Windows during drag-and-drop or clipboard file name operations. Several utility functions in ui/base/clipboard/clipboard_util_win.cc and clipboard_win.cc process external HGLOBAL data structures using raw pointer string assignments without checking their sizes, relying solely on null terminators. If the external source provides data that is not null-terminated, Chrome will read past the allocation boundary, potentially leaking browser-process heap contents to a web page.
Affected files:
ui/base/clipboard/clipboard_util_win.ccui/base/clipboard/clipboard_win.cc
Estimated timestamp from git blame: 2008-07-26
Description
A potential out-of-bounds heap read vulnerability has been identified in the Windows-specific implementation of Chrome's drag-and-drop and clipboard processing utilities. When handling data from external Windows applications via OLE interfaces, Chrome accesses data stored in HGLOBAL allocations. Several functions in ui/base/clipboard/clipboard_util_win.cc and ui/base/clipboard/clipboard_win.cc lock the HGLOBAL but perform string assignments (such as std::u16string::assign or conversion functions like base::UTF8ToUTF16 and base::SysNativeMBToWide) directly on the raw pointer returned by GlobalLock without passing the bounds or checking the actual size of the allocation via GlobalSize().
Because of this, if a buggy or malicious external application exposes drag/clipboard data that is not properly null-terminated within its allocated HGLOBAL boundaries, Chrome's string scanners will read past the allocated block and scan through adjacent browser-process heap memory until a null word (0x0000 or 0x00) is encountered. This over-read data is then stored in the resulting string and sent to the renderer process over Mojo, where it can be read by a web page via standard web drag-and-drop APIs.
Vulnerable Code Analysis
1. Plain Text and HTML Parsing
In ui/base/clipboard/clipboard_util_win.cc:
998: base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);
999: plain_text->assign(base::as_u16cstr(data.data()));
And:
1008: base::win::ScopedHGlobal<char*> data(store.hGlobal);
1009: plain_text->assign(base::UTF8ToUTF16(data.data()));
And in GetHtml:
1054: base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);
1055: html->assign(base::as_u16cstr(data.data()));
In these locations, data.data() returns a pointer to the buffer, but as_u16cstr or UTF8ToUTF16 processes it as a C-style string. Since there is no length limitation, the memory scanning is unbounded.
2. URL and Metadata Parsing
Similar unbounded scans occur during URL extraction in GetUrlInfos (ui/base/clipboard/clipboard_util_win.cc):
- Line 706:
ParseBookmarkListData(base::WideToUTF16(data.data()), url_infos); - Line 719:
SplitUrlAndTitle(base::WideToUTF16(data.data()), &url, &title); - Line 730:
SplitUrlAndTitle(base::UTF8ToUTF16(data.data()), &url, &title);
3. Filename Parsing
In both clipboard_util_win.cc and clipboard_win.cc, filename parsing lacks bounds:
ui/base/clipboard/clipboard_util_win.cc:796:filenames->push_back(data.data());ui/base/clipboard/clipboard_util_win.cc:808:filenames->push_back(base::SysNativeMBToWide(data.data()));ui/base/clipboard/clipboard_win.cc:906:base::FilePath path(filename.data());ui/base/clipboard/clipboard_win.cc:920:base::FilePath path(base::SysNativeMBToWide(filename.data()));
Potential Steps to Trigger the Bug
Note: These are suggested/potential steps to trigger the issue, as our tooling agent does not have the capability to run code to verify them.
- A local application (either buggy or malicious) registers an
IDataObjectcontaining a data format such asCF_UNICODETEXTinside anHGLOBALallocated with size $N$. - The application populates the $N$ bytes with a payload string but omits any null-terminator character inside the allocation.
- The user drags content from this application into a Chrome browser window pointing to an attacker-controlled web page.
- When Chrome receives the drop, it executes
OSExchangeDataProviderWin::GetStringwhich retrieves theHGLOBALdata and performs the unbounded assignment, reading past the $N$-byte boundary and leaking adjacent browser heap data. - The leaked string is serialized into Mojo and forwarded to the renderer process.
- The web page handles the
dropevent and extracts the leaked heap memory viaevent.dataTransfer.getData('text/plain').
Suggested Fix
These functions should be updated to bound their string constructions using GlobalSize or the wrapper's data.size(), and then truncate at any internal null terminator, similar to the hardened implementation in ui/base/clipboard/clipboard_win.cc. For example, in GetPlainText:
base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);
size_t length = data.size() / sizeof(wchar_t);
plain_text->assign(base::as_u16cstr(data.data()), length);
// Truncate at the first null character to mimic native behavior safely
size_t null_pos = plain_text->find(0);
if (null_pos != std::u16string::npos) {
plain_text->resize(null_pos);
}
Evaluated with Chrome root at commit: e9507a33bb4148ee071aaaf8a7e9ad68770359bf
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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
The code locks an HGLOBAL and passes the raw pointer to string functions that scan until a null terminator, without using GlobalSize() to bound the read.
Impact
A malicious local application could cause Chrome to leak browser-process heap memory to a web page during a drag-and-drop or clipboard operation.
What the attacker needed
Malicious local application; victim drags content into Chrome; attacker-controlled web page open
The fix
The string constructions should be bounded using GlobalSize or the wrapper's data.size() and then truncated at the first internal null terminator.
How it was found
- A local application registers an IDataObject with a data format such as CF_UNICODETEXT in an HGLOBAL of size N.
- The application fills the N bytes with a payload but omits any null terminator inside the allocation.
- The user drags content from this application into a Chrome window showing an attacker-controlled page.
- Chrome's GetString performs an unbounded assignment, reading past the N-byte boundary and leaking adjacent heap data.
- The leaked string is serialised over Mojo and sent to the renderer process.
- The web page reads the leaked memory via event.dataTransfer.getData('text/plain') in a drop handler.
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 or drag text, Windows hands the data to Chrome in a block of memory. Chrome assumes the text ends with a special zero marker, but a malicious program can leave that marker out. Chrome then keeps reading past the block into other memory and can pass that leaked data to a website.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.