Insufficient validation of untrusted input in Extensions (CVE-2026-11239)
A compromised renderer can spoof an IPC message to make the browser believe an extension's declarativeContent rule matched, causing the browser to grant the renderer permanent content script privileges for that extension without checking host permissions. The renderer can then impersonate the extension's content script and gain messaging access to the extension's privileged background page.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A compromised renderer can spoof the WatchedPageChange IPC to trick the browser into matching a declarativeContent rule with a RequestContentScript action. This unconditionally grants the renderer permanent content script privileges for that extension, allowing it to bypass security checks and communicate with the extension's background page.
Affected files:
chrome/browser/extensions/api/declarative_content/content_action.ccchrome/browser/extensions/chrome_extension_frame_host.ccchrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.ccextensions/browser/script_injection_tracker.ccchrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.ccextensions/browser/api/messaging/message_service_bindings.cc
Estimated timestamp from git blame: 2023-10-19
Description
A logic flaw exists in the handling of the declarativeContent extension API, specifically concerning the experimental RequestContentScript action.
When a renderer sends an extensions::mojom::LocalFrameHost::WatchedPageChange IPC message containing CSS selectors, the browser's DeclarativeContentCssConditionTracker stores these selectors verbatim and re-evaluates declarative rules. If an installed extension uses a PageStateMatcher that depends only on these CSS selectors, the browser will trigger the associated RequestContentScript action.
The vulnerability occurs in RequestContentScript::InstructRenderProcessToInject. This function unconditionally calls ScriptInjectionTracker::WillExecuteCode, which permanently adds the extension's ID to the renderer process's content_scripts_ allowed list and pushes an isolated world URLLoaderFactory. This happens without verifying if the extension actually has host permissions to run on the attacker-controlled page.
Once added to the content_scripts_ tracker, the compromised renderer can spoof messaging IPCs (like OpenChannelToExtension) claiming to be the extension's content script. The browser's message service bindings will check ScriptInjectionTracker::DidProcessRunContentScriptFromExtension, which will now return true, bypassing the bad_message::EMF_INVALID_EXTENSION_ID_FOR_CONTENT_SCRIPT check. The renderer can then attack the extension's privileged background page.
Note: RequestContentScript is currently an experimental API, which limits the real-world impact to extensions specifically utilizing this feature on supported channels.
Potential Attack Steps
Note: These are suggested steps based on code analysis; our tooling agent does not currently have the ability to run a live proof-of-concept.
- An attacker compromises a main-frame renderer process.
- The attacker identifies an installed extension using
declarativeContent.RequestContentScripttriggered by a CSS-onlyPageStateMatcher. - The compromised renderer sends a spoofed
extensions::mojom::LocalFrameHost::WatchedPageChangeIPC to the browser, providing the exact CSS selectors the target extension is looking for. - The browser blindly accepts these selectors and triggers the
RequestContentScriptaction. RequestContentScript::InstructRenderProcessToInjectunconditionally callsScriptInjectionTracker::WillExecuteCode, permanently granting the renderer process content-script-level trust for that extension.- The compromised renderer sends
extensions::mojom::LocalFrameHost::OpenChannelToExtension, setting the source endpoint type tokContentScriptand the extension ID to the target extension. - The browser validates the request against the newly poisoned
ScriptInjectionTracker, allows the connection, and the attacker gains full messaging access to the extension's background page.
Suggested Fix
- Permission Check Before Trust Grant: In
RequestContentScript::InstructRenderProcessToInject(withinchrome/browser/extensions/api/declarative_content/content_action.cc), add a permissions check to verify that the extension is actually authorized to inject a script into the givenWebContents(e.g., checking host permissions) before callingScriptInjectionTracker::WillExecuteCode. - IPC Validation: Consider adding validation to
ChromeExtensionFrameHost::WatchedPageChangeto ensure the renderer is only reporting on selectors the browser actually requested it to watch.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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.
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 browser trusts renderer-supplied CSS selectors and unconditionally grants content script trust via ScriptInjectionTracker::WillExecuteCode without verifying the extension's host permissions.
Impact
A compromised renderer could bypass security checks and gain full messaging access to an extension's privileged background page, but the impact is limited because RequestContentScript is an experimental API used only by extensions on supported channels.
What the attacker needed
Compromised renderer process; installed extension using RequestContentScript; extension uses CSS-only PageStateMatcher
The fix
The browser should check that the extension actually has host permissions before calling ScriptInjectionTracker::WillExecuteCode, and should validate that the renderer only reports on selectors the browser requested it to watch.
How it was found
- An attacker compromises a main-frame renderer process.
- The attacker identifies an installed extension using declarativeContent.RequestContentScript triggered by a CSS-only PageStateMatcher.
- The compromised renderer sends a spoofed WatchedPageChange IPC to the browser with the exact CSS selectors the target extension is looking for.
- The browser accepts these selectors and triggers the RequestContentScript action.
- InstructRenderProcessToInject unconditionally calls ScriptInjectionTracker::WillExecuteCode, granting the renderer content-script-level trust for that extension.
- The compromised renderer sends OpenChannelToExtension with source endpoint type kContentScript and the target extension ID, and the browser allows the connection, giving the attacker messaging access to the extension's background page.
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 renderer is the part of the browser that draws web pages; if an attacker takes it over, they can send fake internal messages to the browser process. Here, a fake message tricks the browser into thinking an extension should run its content script on the page, even though the extension has no permission to do so. That mistake lets the attacker talk to the extension's background page, which normally has more privileges.
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.