Incorrect authorization in HID (CVE-2026-95314)
A logic flaw in Chrome's WebHID permission handling allows a compromised guest renderer in a webview to bypass permission partitioning during its attachment window. This lets the guest access or revoke WebHID permissions that were granted to its origin in the main user profile.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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 logic flaw in ChromeHidDelegate allows a <webview> guest to bypass WebHID permission partitioning during its attachment window. When a guest's embedder_rfh is unavailable, GetWebViewEmbedderOrigin incorrectly falls back to std::nullopt, treating the guest as a top-level context. This allows a compromised guest renderer to access WebHID permissions granted to its origin in the main user profile.
Affected files:
chrome/browser/hid/chrome_hid_delegate.ccchrome/browser/hid/hid_chooser_context.cc
Estimated timestamp from git blame: 2024-02-23
Summary
A logical permission-bypass vulnerability exists in the WebHID guest isolation mechanism. During the asynchronous attachment window of a WebViewGuest, GetWebViewEmbedderOrigin incorrectly returns std::nullopt (the same value used for non-guest, top-level contexts). When WebHID permission checks or revocations are issued via Mojo IPC during this window, HidChooserContext falls back to checking the main profile-wide grant store instead of restricting the query to the partitioned WebViewChooserContext. This allows a compromised guest renderer to gain unauthorized access to, or revoke, WebHID permissions that the user previously granted to that origin in a top-level profile tab.
Root Cause Analysis
In chrome/browser/hid/chrome_hid_delegate.cc, the helper function GetWebViewEmbedderOrigin distinguishes a guest context from a non-guest context by returning std::optional<url::Origin>:
std::optional<url::Origin> GetWebViewEmbedderOrigin(
content::RenderFrameHost* render_frame_host) {
if (!render_frame_host) {
return std::nullopt;
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (auto* web_view =
extensions::WebViewGuest::FromRenderFrameHost(render_frame_host)) {
auto* embedder_rfh = web_view->embedder_rfh();
if (!embedder_rfh) {
return std::nullopt; // Fails open; indistinguishable from "not a webview"
}
return embedder_rfh->GetMainFrame()->GetLastCommittedOrigin();
}
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
return std::nullopt;
}
However, embedder_rfh() is defined in components/guest_view/browser/guest_view_base.h as:
content::RenderFrameHost* embedder_rfh() const {
return attached() ? owner_rfh() : nullptr;
}
When a guest is in the process of attaching (attach_in_progress_ == true), attached() evaluates to false (per components/guest_view/browser/guest_view_base.h:211-214), meaning embedder_rfh() returns nullptr.
In WebViewGuest::SignalWhenReady, the finalization of the attachment is handled asynchronously while content scripts are being updated:
void WebViewGuest::SignalWhenReady(base::OnceClosure callback) {
auto* manager = WebViewContentScriptManager::Get(browser_context());
manager->SignalOnScriptsUpdated(std::move(callback));
}
This creates a timing window where the guest's WebContents is already executing scripts and can communicate via Mojo, but attached() is still false.
Because GetWebViewEmbedderOrigin returns std::nullopt when embedder_rfh is null, HidChooserContext::HasDevicePermission processes the request as a non-guest context:
if (embedding_origin_of_web_view) {
return web_view_chooser_context_.HasDevicePermission(...);
}
// Fallback to profile-wide ephemeral and persistent grants:
auto it = ephemeral_devices_.find(origin);
...
As a result, the partitioned web_view_chooser_context_ is bypassed, and the query falls back to checking the main profile-wide grants.
Potential Steps to Reproduce
Note: These are potential steps as our tooling does not have the capability to run code directly.
- Establish a top-level user profile where the origin
https://example.comhas been granted WebHID device access (e.g., in a normal browser tab). - Launch an Isolated Web App (IWA) or Chrome App that embeds a
<webview>or<controlledframe>hostinghttps://example.com. - Have the app trigger an asynchronous operation (such as registering content scripts) to stall/delay the guest attachment callbacks.
- Within the guest renderer process (assuming compromise), immediately bind the
blink::mojom::HidServiceMojo pipe as soon as the interface broker is available. - Issue a WebHID permission query (such as calling
GetDevicesorConnect) during the active attachment window. - Observe that the browser process evaluates the permission using the main profile-wide grants instead of the partitioned
WebViewChooserContext, granting the guest unauthorized access to the device.
Impact
This is a logical permission bypass of WebView/Controlled Frame isolation. A compromised guest renderer can access WebHID devices that were previously granted to its origin in top-level tabs, or can revoke those top-level permissions. It does not permit cross-origin access (the origin check still applies to the guest's own origin), nor does it lead to sandbox escape or remote code execution.
Suggested Fix
Instead of failing open and returning std::nullopt when a guest's embedder cannot be verified, GetWebViewEmbedderOrigin should explicitly distinguish between a non-guest context and an unattached guest context.
For example, we can return a std::optional<std::optional<url::Origin>> (where the outer optional indicates if it's a guest context, and the inner optional holds the embedder origin), or explicitly check if extensions::WebViewGuest::FromRenderFrameHost is non-null and deny permission checks/revocations if embedder_rfh() is null.
Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379
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
Likely, the function that checks whether a context is a webview returns 'no value' both for non-webview contexts and for webviews that are not yet fully attached, causing permission checks to fall back to the main profile store instead of the partitioned one.
Impact
A compromised guest renderer could access or revoke WebHID permissions previously granted to its origin in top-level tabs, but it does not allow cross-origin access, sandbox escape, or remote code execution.
What the attacker needed
Victim has granted WebHID permission to an origin; attacker can embed that origin in a webview; attacker can compromise the guest renderer; attacker can delay webview attachment
The fix
The function should explicitly distinguish between a non-guest context and an unattached guest context, for example by returning a nested optional or by denying permission checks when the embedder is null.
How it was found
- Grant WebHID device access to an origin in a normal browser tab.
- Embed that origin in a webview inside an app.
- Delay the webview attachment by triggering an asynchronous operation.
- In the compromised guest renderer, bind the WebHID Mojo interface as soon as possible.
- Issue a WebHID permission query during the attachment window.
- Observe that the browser uses the main profile grants instead of the partitioned webview grants.
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 websites talk to special hardware like keyboards or game controllers, but only after you give permission. Normally, a webview (a webpage embedded inside another app) should have its own separate permissions, not share the main browser's permissions. This bug means that during a brief moment when the webview is still loading, it can wrongly use the main browser's permissions, so a malicious webview could access devices you had allowed for that site elsewhere.
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.