Insufficient policy enforcement in WebUI (CVE-2026-7946)
A compromised WebUI renderer with webview permissions could bypass origin isolation to fetch and read arbitrary chrome:// or chrome-untrusted:// resources. This occurs because the webview.executeScript API incorrectly uses the target URL's scheme and an empty allowed hosts list when creating a WebUIURLLoaderFactory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 42 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A compromised WebUI renderer with <webview> permissions can potentially bypass origin isolation to fetch and read arbitrary chrome:// or chrome-untrusted:// resources. This occurs because the webview.executeScript API incorrectly uses the target URL's scheme and an empty allowed hosts list when creating a WebUIURLLoaderFactory.
Affected files:
extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.ccextensions/browser/api/guest_view/web_view/web_view_internal_api.cccontent/browser/webui/web_ui_url_loader_factory.cc
Estimated timestamp from git blame: 2025-10-01
Summary
A potential vulnerability exists in the WebUI <webview> script and CSS injection APIs (webview.executeScript and webview.insertCSS) that could allow a compromised WebUI renderer to bypass site isolation. If an attacker compromises a WebUI that has <webview> privileges (such as chrome-untrusted://lens/ or chrome://oobe/), they can abuse these APIs to fetch and extract sensitive source code or data from any other chrome:// or chrome-untrusted:// origin.
Note: The following steps are suggested potential steps an attacker might take, as our setup does not have the ability to run code to verify an exploit natively.
Potential Attacker Steps & Technical Details
- Compromise a WebUI: An attacker achieves arbitrary code execution (e.g., via XSS) in a privileged WebUI renderer like
chrome-untrusted://lens/. - Setup Guest Frame: The attacker injects a
<webview>element, navigates it to a controlleddata:URI, and sets up JavaScript traps (e.g.,Proxyobjects on the globalwindow) within the guest frame to capture any subsequently injected scripts. - Invoke Injection API: The attacker calls
document.querySelector('webview').executeScript({file: 'chrome://settings/settings.js'});. - URL Resolution Flaw: In the browser process,
WebViewInternalExecuteCodeFunction::LoadFileForEmbedderresolves thefilestring against the embedder's origin (extensions/browser/api/guest_view/web_view/web_view_internal_api.cc:545). Because the attacker provided an absolute URL,GURL::Resolvereturnschrome://settings/settings.jsas thefile_url. - Improper Factory Creation:
WebUIURLFetcher::Start()then creates aWebUIURLLoaderFactoryto fetch the file (extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.cc:42). Crucially, it requests the factory using the target URL's scheme (url_.GetScheme(), which ischrome) instead of the embedder's scheme (chrome-untrusted). It also passes an empty{}forallowed_hosts. - Security Checks Bypassed: In
WebUIURLLoaderFactory::CreateLoaderAndStart(content/browser/webui/web_ui_url_loader_factory.cc), the request bypasses isolation checks. The scheme check passes because the factory was explicitly created for the target's scheme. The host check (CHECK(allowed_hosts_.empty() || ...)) trivially passes because the allowed hosts set is empty. - Exfiltration: The cross-origin resource is fetched from
URLDataManagerBackend, bypassing renderer-side CORS, and injected into the attacker-controlled guest frame. The attacker's JS traps capture the script contents and send them back to the embedder, successfully breaking WebUI isolation boundaries.
Suggested Fix
- Origin Validation: In
WebViewInternalExecuteCodeFunction::LoadFileForEmbedder, explicitly check that the resolvedfile_urlshares the same origin (or at least the same scheme and host) as the embedder'sowner_base_urlbefore allowing the fetch to proceed. - Strict Factory Binding: Ensure
WebUIURLFetcherinstantiates theWebUIURLLoaderFactoryusing the embedder's scheme and host, rather than deriving it from the potentially attacker-controlled target URL.
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.
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 WebUIURLFetcher creates a WebUIURLLoaderFactory using the target URL's scheme and an empty allowed hosts list, instead of the embedder's scheme and host, bypassing isolation checks.
Impact
A compromised WebUI renderer could read sensitive source code or data from any other chrome:// or chrome-untrusted:// origin, breaking WebUI isolation boundaries.
What the attacker needed
Compromise a WebUI renderer with webview permissions; ability to inject a webview element
The fix
The fix should validate that the resolved file URL shares the same origin as the embedder and create the factory using the embedder's scheme and host.
How it was found
- Compromise a WebUI renderer with webview permissions, e.g., via XSS.
- Inject a webview element and navigate it to a controlled data: URI with JavaScript traps.
- Call webview.executeScript with an absolute chrome:// file path.
- The file URL is resolved against the embedder's origin, yielding the absolute chrome:// URL.
- WebUIURLFetcher creates a factory using the target's scheme and empty allowed hosts.
- The cross-origin resource is fetched and injected into the guest frame, where traps capture it.
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.
WebUI pages are internal browser pages like settings. A webview is an embedded frame that can run scripts. The bug lets a malicious page that already has webview access read files from other internal pages, which should be isolated.
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.