Inappropriate implementation in WebView (CVE-2026-12448)
A logic error in Android WebView's JS injection component causes bridge objects intended for isolated worlds to be created in the main-world V8 context when the kLazyBindJsInjection optimisation is enabled. An attacker could poison the main world's Object.prototype to capture the bridge and then spoof or eavesdrop on messages to the privileged Java backend.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 33 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: A logic error in Android WebView's JS injection component allows untrusted web pages to capture privileged WebMessageListener bridges intended for isolated worlds. When the kLazyBindJsInjection optimization is enabled, bridge objects are instantiated in the main-world V8 context instead of their target isolated-world context. This leads to a cross-world prototype leakage that enables message spoofing and eavesdropping.
Affected files:
components/js_injection/renderer/js_communication.cccomponents/js_injection/renderer/js_binding.ccgin/wrappable.cccomponents/js_injection/browser/js_to_browser_messaging.cccomponents/js_injection/browser/js_communication_host.cc
Estimated timestamp from git blame: 2026-01-09
Summary
There is a potential world-isolation bypass in Android WebView's WebMessageListener feature. When the kLazyBindJsInjection feature is enabled (default-on), the renderer-side initialization improperly manages V8 context scopes. This results in JavaScript bridge objects intended for isolated worlds being instantiated within the main-world context. Consequently, these bridges inherit from the main world's Object.prototype, which can be poisoned by an attacker to capture the bridge instance and interact with the app's Java backend.
Technical Details
Root Cause Analysis
In components/js_injection/renderer/js_communication.cc, the method DidClearWindowObject() handles the installation of JavaScript bridges. If the optimization kLazyBindJsInjection is enabled, it enters a V8 context scope for the main world as a performance optimization:
// components/js_injection/renderer/js_communication.cc
if (base::FeatureList::IsEnabled(kLazyBindJsInjection)) {
isolate = web_frame->GetAgentGroupScheduler()->Isolate();
handle_scope.emplace(isolate);
context = web_frame->MainWorldScriptContext(); // Enters MAIN world
if (context.IsEmpty()) { return; }
context_scope.emplace(context);
}
It then iterates through registered objects and calls JsBinding::Install. However, JsBinding::Install contains logic that skips entering the correct target context if an isolate is already provided:
// components/js_injection/renderer/js_binding.cc
if (!isolate) {
// ... enters context ...
}
// ...
if (!js_binding->GetWrapper(isolate).ToLocal(&wrapper)) { return nullptr; }
Because the code in js_communication.cc provided the isolate, JsBinding::Install remains in the main-world context scope. When gin::WrappableBase::GetWrapper() eventually calls templ->NewInstance(isolate->GetCurrentContext()), V8 creates the bridge instance in the main-world context.
Although the bridge is subsequently attached to the isolated world's global object, it inherits its prototype chain from the main world's Object.prototype rather than the isolated world's.
Potential Attack Scenario
An attacker can potentially trigger this vulnerability using the following steps:
- A malicious page in the main world poisons its
Object.prototypeby defining a getter for a common property (e.g.,Symbol.toPrimitive,then, ortoString). - A trusted script in an isolated world (e.g., an app-injected script) performs an operation on the bridge that triggers a prototype lookup (e.g.,
'' + bridge). - V8 traverses the prototype chain to the main-world
Object.prototype, executing the attacker's getter. The attacker's code can then save the bridge instance to a global variable in the main world. - The attacker uses the captured bridge to call
postMessage(), spoofing communications to the Java backend, or registers a listener to eavesdrop on replies meant for the isolated world.
Impact
Successful exploitation would allow an untrusted web page to bypass isolated-world protections in Android WebView. This enables the attacker to communicate directly with privileged Java APIs intended only for trusted scripts and intercept sensitive data returned by those APIs.
Suggested Fix
Ensure that JsBinding::Install always enters the specific context scope intended for the bridge, regardless of whether an isolate is provided. Alternatively, JsCommunication::DidClearWindowObject should avoid entering a global context scope that doesn't match the target world of the bindings it is installing.
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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 kLazyBindJsInjection optimisation enters the main-world V8 context before calling JsBinding::Install, and JsBinding::Install skips entering the correct target context when an isolate is already provided, so the bridge is instantiated in the main world.
Impact
An untrusted web page could bypass isolated-world protections in Android WebView, communicate directly with privileged Java APIs, and intercept sensitive data returned by those APIs.
What the attacker needed
Android WebView with kLazyBindJsInjection enabled; Victim loads a malicious web page; App uses WebMessageListener bridges
The fix
JsBinding::Install should always enter the specific context scope intended for the bridge, regardless of whether an isolate is provided, or DidClearWindowObject should avoid entering a global context scope that does not match the target world.
How it was found
- A malicious page in the main world poisons its Object.prototype by defining a getter for a common property.
- A trusted script in an isolated world performs an operation on the bridge that triggers a prototype lookup.
- V8 traverses the prototype chain to the main-world Object.prototype, executing the attacker's getter, which saves the bridge instance.
- The attacker uses the captured bridge to call postMessage() to spoof communications or registers a listener to eavesdrop on replies.
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.
Android WebView lets apps inject their own JavaScript into a separate 'isolated world' so that normal web pages cannot interfere with it. A bug in an optimisation meant that some bridge objects were created in the normal web page's world instead, so a malicious page could tamper with JavaScript's built-in object prototype to steal those bridges. Once stolen, the page could send fake messages to the app's native code or listen in on replies.
What is Mobile?
Flaws specific to Android and iOS apps: exported components, deep links, WebViews and data left on the device.