Skip to content
Access control Advisory Advanced CVE-2026-106389

Incorrect authorization in USB (CVE-2026-106389)

The Service Worker USB and HID observers only remember the most recently created service instance for each registration, so older instances are never told when the user revokes permission. An attacker could keep a USB device connection open and retain read/write access after the user revokes permission for the origin.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 6 months

Flapjack, 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 logic error in ServiceWorkerUsbDelegateObserver and ServiceWorkerHidDelegateObserver potentially allows device connections to persist after permission revocation. The observers only track the most recently created service instance per registration, failing to notify older active instances when permissions are revoked.

Affected files:

  • content/browser/service_worker/service_worker_usb_delegate_observer.cc
  • content/browser/service_worker/service_worker_usb_delegate_observer.h
  • content/browser/usb/web_usb_service_impl.cc

Estimated timestamp from git blame: 2023-08-24

Summary

A potential security policy bypass exists in the WebUSB and WebHID implementations for Service Workers. Active device connections can persist even after a user has explicitly revoked permissions for the origin.

This occurs because content::ServiceWorkerUsbDelegateObserver (and identically ServiceWorkerHidDelegateObserver) only tracks the most recently created service instance (WebUsbServiceImpl / HidService) for each Service Worker registration. If multiple Mojo pipes are opened for the same registration, older instances are no longer tracked but remain fully active. When permissions are revoked, only the most recent instance is notified, leaving older instances with persistent, unauthorized access to the hardware.

Technical Details

When a Service Worker requests access to the WebUSB API, WebUsbServiceImpl::Create is called. It creates a new instance and wraps it in a self-owned receiver:

C++
// content/browser/usb/web_usb_service_impl.cc:225
mojo::MakeSelfOwnedReceiver(std::make_unique<WebUsbServiceImpl>(...)

During construction, the service registers itself with the ServiceWorkerUsbDelegateObserver:

C++
// content/browser/service_worker/service_worker_usb_delegate_observer.cc:80
void ServiceWorkerUsbDelegateObserver::RegisterUsbService(
    int64_t registration_id,
    base::WeakPtr<WebUsbServiceImpl> usb_service) {
  Register(registration_id);
  // Overwrite it with `usb_service`, which is the latest one.
  usb_services_[registration_id] = usb_service;
}

Potential Steps to Trigger: (Note: These are suggested steps based on code analysis; a full proof-of-concept exploit has not been executed.)

  1. An attacker's website registers a Service Worker.
  2. The user grants USB permission to the origin.
  3. A compromised renderer opens a blink::mojom::WebUsbService Mojo pipe for the Service Worker. A WebUsbServiceImpl (Instance A) is created and registers itself.
  4. Instance A opens a connection to the USB device. It maintains this connection via a UsbDeviceClient stored in its device_clients_ vector.
  5. The compromised renderer intentionally opens a second blink::mojom::WebUsbService Mojo pipe for the exact same Service Worker context.
  6. A second WebUsbServiceImpl (Instance B) is created. It registers itself, and RegisterUsbService explicitly overwrites the entry for registration_id in usb_services_ with Instance B.
  7. Crucially, Instance A is not destroyed. It is self-owned by its Mojo pipe, which the attacker keeps open. Its connection to the physical USB device remains active.
  8. The user revokes USB permissions for the origin via browser settings.
  9. The browser calls ServiceWorkerUsbDelegateObserver::OnPermissionRevoked.
C++
// content/browser/service_worker/service_worker_usb_delegate_observer.cc:70
void ServiceWorkerUsbDelegateObserver::OnPermissionRevoked(const url::Origin& origin) {
  for (auto const& [id, info] : registration_id_map()) {
    auto* usb_service = GetUsbService(id); // Only returns Instance B
    if (usb_service) {
      usb_service->OnPermissionRevoked(origin);
    }
  }
}
  1. Instance B is notified and closes any connections it has. Instance A is never retrieved, never notified, and never clears its device_clients_. The attacker retains full read/write access to the USB device indefinitely, bypassing the revocation.

Additional Note: WebHID

Codebase analysis indicates that content::ServiceWorkerHidDelegateObserver suffers from the exact same logic flaws in its RegisterHidService and OnPermissionRevoked implementations.

Furthermore, ServiceWorkerHidDelegateObserver::RegistrationRemoved completely fails to erase entries from hid_services_, leading to a memory leak of the map entries (though the WeakPtr will become null).

Suggested Fix

  1. Update ServiceWorkerUsbDelegateObserver and ServiceWorkerHidDelegateObserver to track all active service instances for a given registration ID, not just the latest one. This could be achieved using a collection of weak pointers, such as base::flat_map<int64_t, std::vector<base::WeakPtr<WebUsbServiceImpl>>>.
  2. Update all observer lifecycle events (OnPermissionRevoked, OnDeviceAdded, OnDeviceRemoved, etc.) to iterate through and notify every tracked instance associated with the registration.
  3. Ensure that RegistrationRemoved in both observers properly cleans up the associated maps to prevent memory leaks.

Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f


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 observer stores only one service instance per registration ID, overwriting the previous entry, so permission revocation notifications reach only the latest instance.

Impact

An attacker could retain read and write access to a USB device after the user revokes permission, though the report is based on code analysis and no proof of concept was executed.

What the attacker needed

Victim grants USB permission; compromised renderer; attacker-controlled website

The fix

The observers should track every active service instance per registration and notify all of them on permission changes, and should clean up their maps when a registration is removed.

How it was found

  1. A website registers a Service Worker and the user grants USB permission.
  2. A renderer opens a WebUSB service pipe, creating instance A, which connects to the device.
  3. The renderer opens a second pipe for the same Service Worker, creating instance B and overwriting A in the observer's map.
  4. Instance A stays alive and keeps its device connection.
  5. The user revokes USB permission for the origin.
  6. Only instance B is notified, so instance A keeps its access.

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.

A website can ask for permission to talk to a USB device, and the browser is supposed to cut that access off when you take the permission away. Here the browser only remembered the newest connection object for each background script, so an older one kept working. The result is that a site could still read and write the device after you revoked its permission.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.