Insufficient validation of untrusted input in Extensions (CVE-2026-10969)
A logic flaw in how the browser validates extension messaging IPCs lets a compromised manifest-sandboxed extension page forge its source URL and extension ID, so the browser treats its messages as trusted internal communications. This bypasses externally_connectable checks and lets the sandboxed page impersonate a privileged extension page to the background script.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 24 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 without the Chrome Security team. 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 extension messaging validation allows a compromised manifest-sandboxed extension page to spoof its source URL and extension ID in IPCs. This bypasses 'externally_connectable' checks, allowing the sandboxed page to send messages that appear as trusted 'internal' communications to the extension's privileged background script.
Affected files:
extensions/browser/api/messaging/message_service_bindings.ccextensions/browser/extension_util.ccextensions/browser/api/messaging/message_service.ccextensions/common/api/messaging/messaging_endpoint.ccextensions/browser/extension_frame_host.cc
Estimated timestamp from git blame: 2024-12-10
Description
Manifest-sandboxed extension pages (declared via the sandbox.pages manifest key) are designed to run untrusted content with limited privileges, completely isolated from extension APIs and background scripts (unless explicitly permitted via externally_connectable).
However, a potential vulnerability exists in the browser-side validation of extension messaging IPCs (ExtensionHostMsg_OpenChannelToExtension). A compromised sandboxed renderer can forge its source_endpoint.extension_id and source_url in the IPC payload. The browser incorrectly validates these spoofed values, categorizing the connection as a trusted internal message and bypassing security restrictions. This allows the sandboxed page to impersonate a privileged extension page (like background.js) to the background script, leading to privilege escalation.
Root Cause Analysis
The vulnerability stems from how extensions::MessageService validates the source of an incoming message in extensions/browser/api/messaging/message_service_bindings.cc.
When a sandboxed frame sends an OpenChannelToExtension IPC, the browser calls IsValidSourceUrl to validate the source_url provided by the renderer. If the spoofed source_url does not match the frame's actual committed URL, the browser attempts to resolve it against the frame's actual opaque origin (base_origin):
// In extensions/browser/api/messaging/message_service_bindings.cc
url::Origin source_url_origin = url::Origin::Resolve(source_url, base_origin);
The flaw lies in url::Origin::Resolve(url, base_origin). Because chrome-extension is a standard scheme, Origin::Create(url) successfully parses the spoofed URL (e.g., chrome-extension://<id>/background.js) into a non-opaque origin. Consequently, Origin::Resolve returns this non-opaque origin immediately, completely ignoring the sandboxed frame's opaque base_origin.
Next, because the context is sandboxed, the browser derives a new opaque origin from the result:
if (IsPortContextSandboxed(process, source_context)) {
source_url_origin = source_url_origin.DeriveNewOpaqueOrigin();
}
This creates an opaque origin whose precursor tuple matches the target extension. Finally, the browser checks if the process is allowed to host this origin:
auto* policy = content::ChildProcessSecurityPolicy::GetInstance();
if (!policy->HostsOrigin(process.GetDeprecatedID(), source_url_origin)) { ... }
In ChildProcessSecurityPolicyImpl::MatchesCommittedOrigin, the check succeeds because sandboxed extension pages are placed in a process locked to the extension's site, and the precursor of the newly derived opaque origin matches the extension's origin. The same flaw allows IsValidMessagingSource to validate a spoofed source_endpoint.extension_id.
Because the browser now believes the message originates from the extension itself, MessagingEndpoint::GetRelationship returns Relationship::kInternal. This completely bypasses the externally_connectable manifest key checks in MessageService::OpenChannelToExtension.
When the background script receives the connection (via runtime.onConnect or runtime.onMessage), the JavaScript sender object is populated with the spoofed data:
sender.idis the extension's ID.sender.urlis the spoofed URL (e.g.,chrome-extension://<id>/background.js).
If the background script relies on these fields to authenticate messages, the sandboxed page can execute privileged actions.
Potential Steps to Reproduce
Note: These are potential steps as our tooling cannot execute code.
- Install an extension that has a background script/service worker and a sandboxed page (e.g.,
sandbox.html). The background script must listen for internal messages and perform privileged actions based on them. - Navigate to the sandboxed page.
- Assume an attacker compromises the sandboxed renderer process (e.g., via a standard renderer exploit).
- From the compromised renderer, use the
mojom::LocalFrameHostinterface to send anOpenChannelToExtensionIPC viaExtensionFrameHostwith the following parameters:source_endpoint.type=kExtensionsource_endpoint.extension_id=<extension_id>target_id=<extension_id>source_url="chrome-extension://<extension_id>/background.js"(spoofed)
- The browser process validates these parameters. Due to the flaw in URL resolution and precursor matching, it treats the message as legitimate internal communication, bypassing
externally_connectablechecks. - The extension's background script receives the connection with the spoofed
sender.urlandsender.id, allowing the attacker to interact with the privileged background context.
Suggested Fix
- Strict URL Validation:
IsValidSourceUrlshould be hardened. Ifsource_urldoes not matchframe->GetLastCommittedURL(), and the frame is sandboxed (meaning its origin is opaque), it should not be possible to resolve a standardchrome-extension://URL and have it accepted simply because the precursor matches. - Origin Comparison: Instead of relying solely on
policy->HostsOrigin(which only checks process locks and precursors for opaque origins), the messaging system should verify that thesource_urlprovided by the renderer strictly corresponds to the frame's actual committed origin or URL, especially for sandboxed contexts where the origin is opaque.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
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. 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 resolves the renderer-supplied source URL against the frame's opaque origin in a way that accepts a standard chrome-extension URL outright, then derives an opaque origin whose precursor matches the extension, so the process-lock check passes for a spoofed source.
Impact
A compromised sandboxed page could impersonate a privileged extension page and trigger privileged actions in the background script, but only if that script trusts the sender fields and the attacker already controls the renderer.
What the attacker needed
Attacker already controls the sandboxed renderer; extension has a sandboxed page; background script trusts sender fields
The fix
The validation should be hardened so a sandboxed frame cannot have a spoofed chrome-extension URL accepted just because the derived origin's precursor matches, and the source URL should be checked strictly against the frame's committed URL or origin.
How it was found
- Install an extension with a background script and a sandboxed page, where the background script acts on internal messages.
- Navigate to the sandboxed page.
- Assume the attacker has compromised the sandboxed renderer process.
- From the compromised renderer, send an OpenChannelToExtension IPC with a spoofed extension ID and source URL.
- The browser validates the spoofed values and treats the message as legitimate internal communication.
- The background script receives the connection with the spoofed sender details.
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.
Extensions can mark some of their pages as 'sandboxed', meaning they run untrusted content with almost no powers. Normally such a page cannot talk to the extension's powerful background script unless the extension explicitly allows outside messages. Here, a page that has already been taken over by an attacker can lie about who it is, and the browser believes it, so the page gets to talk to the powerful part as if it were the extension itself.
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.