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

Insufficient policy enforcement in WebHID (CVE-2026-13864)

A logic error in Chrome's WebHID permission check lets a GuestView embedder frame an origin that enterprise policy authorises for HID access, inject script into it, and use that origin's HID permissions. An attacker could then read and write to enterprise-restricted HID devices without the embedder itself holding permission.

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.

Overview: A logic error in HidChooserContext::HasDevicePermission allows GuestViews to bypass isolation checks and access HID devices granted to an origin by enterprise policy. Because the policy check occurs before the GuestView embedder check, an untrusted embedder can frame a policy-authorized origin and inject scripts to hijack its HID access. This potentially enables unauthorized access to enterprise-restricted hardware without user interaction.

Affected files:

  • chrome/browser/hid/hid_chooser_context.cc
  • chrome/browser/hid/web_view_chooser_context.cc
  • chrome/browser/hid/hid_policy_allowed_devices.cc

Estimated timestamp from git blame: 2023-06-14

Summary

There is a potential cross-origin confused-deputy privilege escalation in Chrome's WebHID implementation. A logic flaw in HidChooserContext::HasDevicePermission allows origins authorized by enterprise HID policies to access HID devices even when they are running within a restricted GuestView context (such as <webview> or <controlledframe>).

This bypasses the isolation mechanism intended to require the embedder of the GuestView to possess the permission and explicitly delegate it to the guest context.

Code Analysis

In chrome/browser/hid/hid_chooser_context.cc, the function HasDevicePermission determines if a context has permission to access a specific HID device. The implementation currently checks for an enterprise policy match before checking for GuestView embedder isolation:

C++
484:   if (CanApplyPolicy() &&
485:       HidPolicyAllowedDevicesFactory::GetForProfile(profile_)
486:           ->HasDevicePermission(origin, device)) {
487:     return true;  // <--- Early return bypasses GuestView checks
488:   }
...
490:   if (!CanRequestObjectPermission(origin))
491:     return false;
492: 
493:   if (embedding_origin_of_web_view) {
494:     return web_view_chooser_context_.HasDevicePermission(
495:         origin, *embedding_origin_of_web_view, device);
496:   }

When a request originates from a GuestView, the origin parameter is the guest's origin, and embedding_origin_of_web_view is the untrusted embedder's origin. If an enterprise policy (such as WebHidAllowDevicesForUrls) grants permission to the guest's origin, line 487 returns true immediately.

This skips the logic at line 493, which is intended to enforce the WebViewChooserContext invariant: a guest should only have access if the embedder also has permission and has specifically granted it to the guest.

Potential Attack Steps

Note: These are suggested steps based on static analysis, as our setup does not yet have the ability to run code or construct a live PoC.

  1. Attacker Setup: The attacker distributes a malicious application (e.g., an Isolated Web App or Chrome Extension) requesting controlled-frame or webview permissions.
  2. Framing the Target: The application uses <webview> or <controlledframe> to embed a target enterprise origin (e.g., https://internal.corp) known to be authorized for sensitive HID access via the WebHidAllowDevicesForUrls policy. This framing succeeds because GuestViews act as outermost main frames and bypass X-Frame-Options and CSP: frame-ancestors.
  3. Script Injection: The attacker's embedder application calls executeScript on the guest element. For GuestViews, executeScript unconditionally allows script injection into the guest without requiring standard extension host permissions for that origin.
  4. Triggering WebHID: The injected script running in the guest context calls navigator.hid.getDevices() and device.open().
  5. The Bypass: The browser processes the IPCs and calls HidChooserContext::HasDevicePermission. Because the guest origin matches the enterprise policy, it returns true early, completely ignoring the embedder's lack of authorization.
  6. Exfiltration: The injected script now has live I/O capabilities with the enterprise-restricted HID device and proxies this data back to the attacker's embedder application (e.g., via postMessage).

Suggested Fix

To resolve this issue, the embedder validation must take precedence over or strictly encompass the guest's policy grants.

The if (embedding_origin_of_web_view) block in HidChooserContext::HasDevicePermission (lines 493-496) should be moved above the enterprise policy check. Alternatively, if enterprise policies are intended to apply within GuestViews, the policy check must be modified to verify that the embedding_origin_of_web_view is also authorized by the policy or otherwise explicitly permitted to embed the privileged guest.

Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8


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 enterprise policy check in HasDevicePermission returns true before the GuestView embedder isolation check runs, so a policy-authorised guest origin is granted access regardless of its untrusted embedder.

Impact

An attacker could gain unauthorised access to enterprise-restricted HID hardware without user interaction, though the report is based on static analysis and no live proof of concept was run.

What the attacker needed

Attacker can distribute an app with webview or…; target origin is authorised by enterprise HID policy; victim runs the attacker's application

The fix

The embedder validation should be moved above the enterprise policy check, or the policy check should also verify that the embedding origin is authorised.

How it was found

  1. The attacker distributes an application that can create a webview or controlled frame.
  2. The application embeds an enterprise origin that policy authorises for HID access.
  3. The attacker injects script into the guest with executeScript.
  4. The injected script calls navigator.hid.getDevices() and device.open().
  5. The permission check returns true early because of the policy match, ignoring the embedder.
  6. The script proxies device data back to the attacker's application.

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.

WebHID lets a website talk to hardware devices such as keyboards or security keys. Chrome normally requires the page that frames another page to hold the permission itself before the inner page can use a device. Here the enterprise-policy check ran first and returned success, so the framing page never had to prove it was allowed.

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.