Insufficient data validation in Extensions (CVE-2026-12457)
A missing check for error documents in the subframe traversal of ScriptExecutor allows a compromised renderer to make the browser believe an extension is injecting scripts into its process. This could let the attacker bypass process isolation and access privileged extension resources such as storage or internal messaging.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 21 days
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: When an extension executes a script with allFrames: true, ScriptExecutor::Handler::MaybeAddSubFrame fails to check if a frame is an error document. This allows a compromised renderer to trick the browser's ScriptInjectionTracker into believing an extension is executing scripts inside its process. Consequently, the attacker can bypass process isolation boundaries to access privileged extension resources.
Affected files:
extensions/browser/script_executor.cc
Estimated timestamp from git blame: 2026-04-13
Root Cause Analysis
In extensions/browser/script_executor.cc, when executing a script with allFrames: true, ScriptExecutor::Handler recursively traverses all descendant frames of the target page. While the explicit-frameId path correctly performs an IsErrorDocument() check to avoid injecting into error pages, the subframe traversal path in MaybeAddSubFrame misses this validation:
// extensions/browser/script_executor.cc (MaybeAddSubFrame)
if (!frame->IsRenderFrameLive() ||
std::ranges::contains(pending_render_frames_, frame)) {
return content::RenderFrameHost::FrameIterationAction::kContinue;
}
// Missing: if (frame->IsErrorDocument()) check!
Because HasPermissionToInjectIntoFrame relies on RenderFrameHost::GetLastCommittedURL(), and error documents preserve the failed navigation URL (rather than using a chrome-error:// URL), the permission check evaluates the target URL instead of the actual error context.
Under specific conditions, a blocked navigation to a target site commits an error document directly inside the initiator's process (e.g., the attacker's process) rather than isolating it. In particular, renderer-initiated subframe navigations failing with a request-blocked error (e.g., net::ERR_BLOCKED_BY_CSP) commit in the current site instance (ErrorPageProcess::kCurrentProcess).
Potential Threat Model and Trigger Path
Please note: Since our analysis is purely static and we currently do not have the capability to run code or execute a dynamic proof-of-concept, the following describes a potential attack path.
-
Preconditions:
- An attacker controls a third-party origin
https://thirdparty.examplerunning in a site-isolated renderer process $P_{attacker}$. - A benign extension with host permissions for
https://target.example/*is installed and programmatically executes scripts withallFrames: true(e.g., in response to a tab update).
- An attacker controls a third-party origin
-
Triggering the Vulnerability:
- The user navigates to
https://target.example/page(process $P_{target}$), which embeds an iframe pointing tohttps://thirdparty.example/widget($P_{attacker}$). - The attacker-controlled page at
https://thirdparty.example/widgetis served with the HTTP headerContent-Security-Policy: frame-src 'none'. - The attacker's script programmatically inserts a grandchild iframe to
https://target.example/x. - Due to the CSP restriction, this navigation fails with
net::ERR_BLOCKED_BY_CSPand commits directly within the grandchild frame inside the attacker's process $P_{attacker}$ (since it is a subframe and the error is a request-blocked error). ItsGetLastCommittedURL()returnshttps://target.example/x, andIsErrorDocument()istrue.
- The user navigates to
-
Exploiting the State:
- The benign extension invokes
executeScript({allFrames: true}).ScriptExecutor::Handlerwalks the frames. - It visits the grandchild frame. Since
IsErrorDocument()is not checked inMaybeAddSubFrame(), andGetLastCommittedURL()ishttps://target.example/x,HasPermissionToInjectIntoFrame()returnstrue. - The frame is added to
pending_render_frames_, which triggersScriptInjectionTracker::WillExecuteCode()and registers the extension as having executed a script in $P_{attacker}$. - Now, a compromised renderer in $P_{attacker}$ can successfully pass browser-side validation checks like
CanRendererActOnBehalfOfExtension()orIsValidMessagingSource(). This allows the attacker to escalate privileges to access extension storage (viachrome.storage.local) or dispatch internal messages to the extension's background page/service worker.
- The benign extension invokes
Suggested Remediation
In extensions/browser/script_executor.cc, update MaybeAddSubFrame to explicitly check and skip error documents:
if (frame->IsErrorDocument()) {
return content::RenderFrameHost::FrameIterationAction::kContinue;
}
This ensures that error pages in descendants are consistently ignored during subframe programmatic injections, matching the explicit-frameId execution path.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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 subframe traversal in MaybeAddSubFrame omits the IsErrorDocument() check that the explicit-frameId path performs, so error documents with a preserved target URL are treated as normal frames for permission checks.
Impact
A compromised renderer could bypass process isolation and access extension storage or dispatch internal messages to the extension's background page, but the analysis is static and no dynamic proof-of-concept was run.
What the attacker needed
Attacker controls a third-party origin; benign extension with host permissions for target; extension runs executeScript with allFrames: true; user navigates to target page with attacker iframe
The fix
The code should be fixed by adding an IsErrorDocument() check in MaybeAddSubFrame to skip error documents, matching the explicit-frameId path.
How it was found
- The user navigates to a target page that embeds an iframe from an attacker-controlled origin.
- The attacker's page is served with a CSP that blocks frame loading.
- The attacker's script inserts a grandchild iframe to the target origin, which fails with a request-blocked error and commits an error document inside the attacker's process.
- The benign extension runs executeScript with allFrames: true, and the frame walker visits the grandchild error document.
- Because IsErrorDocument() is not checked, the frame's last committed URL passes the permission check and the frame is added to pending_render_frames_.
- The compromised renderer can then pass browser-side validation checks and access extension storage or internal messages.
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.
Browser extensions can run scripts on web pages, and the browser checks whether the extension has permission for each page. A bug meant that when an extension ran a script on all frames, the browser did not notice that one frame was actually an error page. A malicious page could use this to make the browser think the extension trusted it, potentially giving the attacker access to the extension's private data.
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.