Skip to content
Race condition Advisory Advanced CVE-2026-13882

Inappropriate implementation in USB (CVE-2026-13882)

A race condition in the browser's WebUSB implementation allows a compromised renderer to bypass the blocklist of protected USB interface classes. By sending a configuration change and an interface claim in quick succession, an attacker could gain raw access to interfaces such as HID keyboards or smart cards.

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 without the security team.

Overview: A Time-of-Check Time-of-Use (TOCTOU) race condition in the WebUSB Device Service allows a compromised renderer to bypass the protected-interface-class blocklist. By sending a SetConfiguration Mojo request followed immediately by a ClaimInterface request, the browser validates the claim against stale configuration metadata but executes the claim against the newly set configuration. This can potentially grant an attacker raw access to protected USB interfaces like HID keyboards or smart cards.

Affected files:

  • services/device/usb/mojo/device_impl.cc
  • services/device/usb/usb_device_handle_usbfs.cc
  • services/device/usb/usb_device_handle_impl.cc
  • services/device/usb/usb_device.cc
  • services/device/usb/usb_device_impl.cc

Estimated timestamp from git blame: 2026-01-06

Summary

A Time-of-Check Time-of-Use (TOCTOU) vulnerability exists in the browser's WebUSB implementation (services/device/usb/mojo/device_impl.cc). The vulnerability arises because DeviceImpl::SetConfiguration updates the device's configuration asynchronously on a background thread, while DeviceImpl::ClaimInterface validates interface claims synchronously on the main thread using potentially stale state before posting the actual claim operation to the same background thread.

A compromised renderer can bypass Blink's JavaScript-level concurrency checks and send pipelined Mojo messages to exploit this. By carefully timing a SetConfiguration and a ClaimInterface request, the renderer can trick the browser into validating an interface against an old, permissive configuration, while the underlying OS claims the interface under a new, restricted configuration.

Potential Steps to Trigger

These are the suggested steps an attacker would follow to trigger this vulnerability:

  1. Preconditions: The attacker compromises a renderer process (e.g., via a v8 bug) and the user has granted WebUSB access to a USB device with at least two configurations (Config A and Config B).
    • Config A contains a harmless interface (e.g., Vendor Specific, class 0xFF) at index N.
    • Config B contains a protected interface (e.g., HID, class 0x03, which is in blocked_interface_classes_) at the exact same index N.
  2. Bypass JS checks: The compromised renderer bypasses USBDevice::EnsureNoDeviceOrInterfaceChangeInProgress in Blink and communicates directly with the mojom::UsbDevice interface.
  3. Initiate Configuration Change: The renderer sends a SetConfiguration(Config B) Mojo message. DeviceImpl::SetConfiguration receives this and posts the task to a sequenced background task runner (e.g., helper_ on Linux/Android or blocking_task_runner_ on macOS). The browser's active configuration state is not updated yet.
  4. Initiate Interface Claim: The renderer immediately sends a ClaimInterface(N) Mojo message.
  5. Stale State Validation: DeviceImpl::ClaimInterface synchronously calls device_->GetActiveConfiguration() to validate the interface against the blocked_interface_classes_ list. Since the background task hasn't finished, this returns the metadata for the old Config A. The check sees a benign Vendor Specific interface and permits the claim, posting it to the same background task runner.
  6. Sequential Execution: The background thread executes the tasks sequentially:
    • It issues a synchronous USB control transfer to the OS to switch the physical device to Config B.
    • It immediately issues an ioctl/request to claim interface N. Since the device is now in Config B, the OS claims the protected HID interface. Because these requests execute back-to-back, native OS drivers (like usbhid) do not have time to asynchronously bind and lock the interface.
  7. State Synchronization: The completion callbacks run on the main thread in order. The configuration state is updated to Config B. Then, ClaimInterfaceComplete runs and calls RefreshEndpointInfo(), which caches the protected endpoints of Config B's interface N into the browser's allowed endpoints_ map.
  8. Exploitation: The compromised renderer can now send GenericTransferIn or GenericTransferOut Mojo messages to the protected endpoints. The browser allows them because they exist in the endpoints_ map, granting the attacker raw USB access to the restricted interface (e.g., injecting keystrokes).

Suggested Fix

The DeviceImpl class must enforce synchronization between configuration changes and interface claims.

A potential fix is to introduce a state flag (e.g., bool device_state_change_in_progress_) in DeviceImpl that is set when a SetConfiguration or Reset operation is pending. If ClaimInterface, SetInterfaceAlternateSetting, or similar methods are called while this flag is true, they should immediately fail and return an error (or be queued until the configuration change is complete). Alternatively, the interface class validation could be deferred and performed inside the completion callback on the main thread after the configuration change has definitively occurred.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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.

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

The configuration change is performed asynchronously on a background thread while the interface claim is validated synchronously on the main thread using stale configuration state.

Impact

A compromised renderer could gain raw USB access to protected interfaces, potentially allowing keystroke injection or smart card access.

What the attacker needed

Compromised renderer process; WebUSB permission granted for a device with two…; device has a protected interface at the same index as a…

The fix

The DeviceImpl class should enforce synchronization between configuration changes and interface claims, for example by using a state flag to reject or queue claims during a pending configuration change.

How it was found

  1. Compromise a renderer process and obtain WebUSB permission for a device with two configurations where a harmless interface and a protected interface share the same index.
  2. Bypass Blink's JavaScript-level checks and send Mojo messages directly to the browser process.
  3. Send a SetConfiguration request for the configuration containing the protected interface.
  4. Immediately send a ClaimInterface request for the shared index.
  5. The browser validates the claim against the old configuration and allows it, then executes the claim after the configuration change.
  6. Use GenericTransferIn or GenericTransferOut to communicate with the now-accessible protected interface.

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.

WebUSB lets websites talk to USB devices, but the browser blocks access to sensitive interfaces like keyboards to prevent abuse. This report shows that if an attacker already controls part of the browser, they can trick the browser into allowing access to those blocked interfaces by changing the device configuration at just the right moment.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.