Skip to content
Memory corruption Advisory Advanced CVE-2026-8515

Use after free in HID (CVE-2026-8515)

A use-after-free exists in Chrome's Windows HID connection close routine because it cancels pending I/O with CancelIo but frees the OVERLAPPED structures before the kernel finishes cancellation. An attacker with WebHID permission could trigger a kernel write into freed heap memory, potentially leading to sandbox escape and remote code execution.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 49 days

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A potential use-after-free vulnerability exists in HidConnectionWin::PlatformClose where pending asynchronous I/O is canceled using CancelIo without waiting for kernel cancellation to finish. The associated OVERLAPPED structures are immediately freed, allowing the Windows kernel to perform a write-after-free into the browser process's heap when it writes the delayed I/O completion status. This kernel-originated memory corruption bypasses MiraclePtr protections and could lead to sandbox escape and remote code execution.

Affected files:

  • services/device/hid/hid_connection_win.cc

Estimated timestamp from git blame: 2020-12-29

Description

A potential use-after-free (UAF) vulnerability exists in HidConnectionWin::PlatformClose within services/device/hid/hid_connection_win.cc. The implementation calls the Windows CancelIo API to stop pending asynchronous I/O but immediately proceeds to free the underlying OVERLAPPED structures and data buffers without ensuring that the Windows kernel has finished using them.

Technical Details

In HidConnectionWin::PlatformClose, the code iterates through open file handles, calls CancelIo, closes the handle, and then immediately clears the transfers_ list:

C++
void HidConnectionWin::PlatformClose() {
  for (auto& entry : file_handles_) {
    CancelIo(entry->file_handle.Get());
    entry->file_handle.Close();
  }
  file_handles_.clear();
  transfers_.clear();
}

On Windows, CancelIo is an asynchronous operation. It marks pending I/O requests for cancellation and returns immediately; it does not synchronously wait for the kernel to finish canceling the I/O Request Packet (IRP). The kernel must still complete the IRP, which involves asynchronously writing the final status (e.g., STATUS_CANCELLED) and the number of bytes transferred to the Internal and InternalHigh fields of the provided OVERLAPPED structure.

The transfers_.clear() call immediately destroys the PendingHidTransfer objects. These objects contain inline OVERLAPPED structures and hold references to the RefCountedBytes buffers used for the I/O. Since CancelIo does not wait, the kernel continues to hold the raw user-mode virtual address of the OVERLAPPED structure and the buffer. When the kernel completes the cancellation, it will attempt to write the final status to these memory locations after they have been freed and potentially reallocated by PartitionAlloc.

Impact and Severity

This issue results in a highly reliable, kernel-originated heap write-after-free in the browser process (the Device Service is hosted in the browser process on Windows). Because the Windows kernel writes directly to the raw user-mode virtual address of the OVERLAPPED structure, Chrome's MiraclePtr (BackupRefPtr) protection is entirely bypassed as it only protects C++ raw_ptr<T> types, not raw memory addresses held by the OS.

An attacker who has obtained WebHID permissions (granted via a user prompt) can trigger this vulnerability by closing the HID connection while I/O is pending. By grooming the heap, an attacker could place sensitive objects (e.g., objects with vtables) in the reclaimed memory slots before the kernel write occurs, potentially leading to a full sandbox escape and remote code execution.

Potential Attacker Steps (Unverified)

(Note: These are potential steps as a working proof-of-concept has not been run.)

  1. A malicious webpage requests and receives WebHID access via navigator.hid.requestDevice(), which prompts the user.
  2. The attacker opens a connection to the device using device.open(), creating a HidConnectionWin in the browser process which automatically initiates asynchronous reads.
  3. The attacker deliberately closes the connection (e.g., via device.close() or by destroying the Mojo remote) while read operations are still pending.
  4. HidConnectionWin::PlatformClose() calls CancelIo and immediately frees the PendingHidTransfer objects.
  5. The attacker rapidly allocates objects of similar size in the browser process to reclaim the freed memory slots.
  6. The Windows kernel finishes canceling the I/O and writes STATUS_CANCELLED to the freed OVERLAPPED structure, corrupting the attacker's newly allocated object.

Recommended Fix

The implementation must ensure that all pending I/O operations have reached a terminal state before the associated OVERLAPPED structures and buffers are destroyed. This can be achieved by iterating through the pending transfers and synchronously waiting for their completion after calling CancelIo.

For example, calling GetOverlappedResult with bWait=TRUE for all pending transfers, or waiting for the associated event handle (overlapped_.hEvent) to become signaled, will ensure the kernel is completely finished with the memory before it is freed.

Evaluated with Chrome root at commit: bb48272cafb7e24c93f55ef40da398cd206ee651


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 code calls CancelIo and frees the OVERLAPPED structures without waiting for the kernel to complete the cancellation, so the kernel later writes to freed memory.

Impact

This could lead to a full sandbox escape and remote code execution, and the kernel-originated write bypasses MiraclePtr protections.

What the attacker needed

WebHID permission granted by user; Windows operating system; Attacker can trigger close while I/O pending

The fix

The implementation should ensure that all pending I/O operations have reached a terminal state before the associated OVERLAPPED structures and buffers are destroyed, for example by synchronously waiting for their completion after calling CancelIo.

How it was found

  1. A malicious webpage requests and receives WebHID access via navigator.hid.requestDevice(), which prompts the user.
  2. The attacker opens a connection to the device using device.open(), creating a HidConnectionWin in the browser process which automatically initiates asynchronous reads.
  3. The attacker deliberately closes the connection (e.g., via device.close() or by destroying the Mojo remote) while read operations are still pending.
  4. HidConnectionWin::PlatformClose() calls CancelIo and immediately frees the PendingHidTransfer objects.
  5. The attacker rapidly allocates objects of similar size in the browser process to reclaim the freed memory slots.
  6. The Windows kernel finishes canceling the I/O and writes STATUS_CANCELLED to the freed OVERLAPPED structure, corrupting the attacker's newly allocated object.

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 a program asks the operating system to read from a device, it gives the system a small memory box to store the result. Here, the program told the system to cancel the read and then immediately threw away that box. The system later tried to write the cancellation result into the box that no longer exists, which can corrupt memory and let an attacker take control.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.