Skip to content
Mobile Advisory Advanced CVE-2026-11295

Inappropriate implementation in WebView (CVE-2026-11295)

Messages queued during prerendering for multiple WebMessageListeners in Android WebView are stored in a single shared per-document queue. When the page activates, the first listener processed drains the entire queue, so an untrusted main-world script could spoof messages to a privileged isolated-world listener.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 50 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.

Overview: When an Android WebView app uses multiple WebMessageListeners and enables prerendering, messages queued during the prerendering phase are stored in a single shared per-document queue. Upon page activation, the first listener processed drains the entire queue, leading to misrouted messages. This could allow an untrusted main-world script to spoof messages to a privileged isolated-world listener.

Affected files:

  • components/js_injection/browser/js_to_browser_messaging.cc
  • components/js_injection/browser/js_communication_host.cc
  • components/js_injection/browser/js_to_browser_messaging.h
  • components/js_injection/browser/js_communication_host.h

Estimated timestamp from git blame: 2024-05-14

Note: These are suggested/potential steps to trigger the issue, as our tooling agent doesn't yet have the ability to run code to verify an end-to-end exploit.

Technical Details

Android WebView allows apps to inject JavaScript objects into pages using addWebMessageListener. When a page is being prerendered, JsToBrowserMessaging::PostMessage defers message delivery until the page activates. It does this by storing messages in JsToBrowserMessagingDocumentUserData:

C++
// components/js_injection/browser/js_to_browser_messaging.cc:253
if (render_frame_host_->IsInLifecycleState(
        content::RenderFrameHost::LifecycleState::kPrerendering)) {
  JsToBrowserMessagingDocumentUserData* data =
      JsToBrowserMessagingDocumentUserData::GetOrCreateForCurrentDocument(
          render_frame_host_);
  data->queued_messages().push_back(std::move(web_message));
  return;
}

Because JsToBrowserMessagingDocumentUserData inherits from content::DocumentUserData, it is a singleton per RenderFrameHost document. As a result, all JsToBrowserMessaging instances (representing different listeners/worlds) for a given document share the exact same message queue.

Upon activation, JsCommunicationHost::RenderFrameHostStateChanged iterates through all registered listeners. The iteration order is determined by a std::map keyed by std::pair<std::u16string, int32_t> (the listener name and world ID). The first listener in this sorted map that has an initialized host_ will call OnRenderFrameHostActivated(), iterate over the shared queue, dispatch every message to its own handler, and then clear the queue.

Potential Attack Scenario

  1. Prerequisites: A target WebView app explicitly enables speculative loading (SpeculativeLoadingAllowedFlags::PRERENDER_ENABLED). It registers two listeners: a privileged one in an isolated world (e.g., named "appBridge") and a standard one in the main world (e.g., named "pageBridge").
  2. Trigger Prerender: An attacker-controlled main-world page triggers a prerender of another attacker-controlled URL (e.g., via <script type="speculationrules">).
  3. Queue Initialization: During the prerender, the app's trusted isolated-world script executes and posts an initial benign message to "appBridge". This initializes the host_ for the "appBridge" listener and adds the message to the shared per-document queue.
  4. Payload Injection: The attacker's main-world script in the prerendered page posts a malicious payload to its own listener: pageBridge.postMessage("exploit_payload"). This payload is appended to the same shared queue.
  5. Activation & Spoofing: The prerendered page is activated. The browser iterates over the listeners. Because "appBridge" sorts alphabetically before "pageBridge", its OnRenderFrameHostActivated() method is called first. It drains the shared queue, successfully receiving the attacker's "exploit_payload" intended for the less privileged listener.

Suggested Fix

Avoid using a document-level singleton queue to store messages from different listeners.

The queued_messages_ queue should be moved directly into the JsToBrowserMessaging class itself as a private member variable. Because each JsToBrowserMessaging instance corresponds to a specific listener and world, this ensures that messages queued during prerendering are kept strictly separated by destination.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 message queue is stored as a document-level singleton shared by all listeners, instead of being kept per listener.

Impact

An untrusted main-world script could spoof messages to a privileged isolated-world listener, potentially leading to unintended actions, though the report notes the steps are suggested and not verified end-to-end.

What the attacker needed

Android WebView app enables prerendering; App registers multiple WebMessageListeners; Attacker controls a page that can trigger prerender; Victim uses the vulnerable app

The fix

The queued_messages_ queue should be moved into the JsToBrowserMessaging class as a private member so that messages are kept separated by destination listener.

How it was found

  1. An app enables prerendering and registers two listeners: a privileged isolated-world listener and a main-world listener.
  2. An attacker-controlled page triggers a prerender of another attacker-controlled URL.
  3. During prerender, the app's isolated-world script posts a benign message to the privileged listener, initialising its host and adding the message to the shared queue.
  4. The attacker's main-world script posts a malicious payload to its own listener, which is appended to the same shared queue.
  5. The prerendered page activates; the browser processes the privileged listener first because its name sorts earlier, and that listener drains the shared queue, receiving the attacker's payload.

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 apps can use WebView to let web pages talk to the app through special JavaScript objects called listeners. When a page is prepared in the background (prerendering), messages meant for different listeners are put into one shared queue. When the page becomes active, the first listener takes all the messages, so a malicious page could send a fake message to a trusted listener.

What is Mobile?

Flaws specific to Android and iOS apps: exported components, deep links, WebViews and data left on the device.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Mobile app vulnerabilities

The lesson behind this report.

Flaws specific to Android and iOS apps: exported components, deep links, WebViews and data left on the device.