Information loss in CustomTabs (CVE-2026-113238)
Chrome Custom Tabs on Android misreports the origin of messages received via MessagePorts by always using the main frame's URL. An attacker controlling a cross-origin iframe that receives a transferred port can impersonate the trusted top-level origin to a host app.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 months
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: Chrome Custom Tabs (CCT) misreports the origin of messages received via MessagePorts by always attributing them to the main frame's URL. This allows a cross-origin context to impersonate a trusted top-level origin to a host Android application if a MessagePort is transferred to it.
Affected files:
chrome/android/java/src/org/chromium/chrome/browser/browserservices/PostMessageHandler.java
Estimated timestamp from git blame: Unknown (Google3 checkout)
Root Cause analysis
In the Chrome Custom Tabs (CCT) implementation on Android, PostMessageHandler.java handles two-way communication between a host app and a web page using a MessagePort. When a message is received from the web page, the handler populates the androidx.browser.customtabs.POST_MESSAGE_ORIGIN bundle extra, which host applications frequently use to make security decisions.
The current implementation in chrome/android/java/src/org/chromium/chrome/browser/browserservices/PostMessageHandler.java determines the origin of an incoming message by querying the current state of the WebContents:
// PostMessageHandler.java:85
Bundle bundle = null;
GURL url = mWebContents.getMainFrame().getLastCommittedURL();
if (url != null) {
String origin = GURLUtils.getOrigin(url.getSpec());
bundle = new Bundle();
bundle.putString(POST_MESSAGE_ORIGIN, origin);
}
This logic assumes that messages delivered over the MessagePort always originate from the primary main frame. However, according to the HTML specification, MessagePort objects are transferable. A trusted top-level page (e.g., https://trusted.example) can receive a port from the host app and transfer it to a cross-origin iframe (e.g., https://evil.example). When the iframe sends a message through this port, PostMessageHandler incorrectly labels it with the origin of the main frame (https://trusted.example).
Vulnerability Mechanism
Our investigation of the underlying layers reveals that Chromium's C++ layer accurately tracks the sender's origin. When MessagePort.postMessage is called in the renderer, blink::MessagePort populates the sender_origin field in a blink::TransferableMessage (third_party/blink/renderer/core/messaging/message_port.cc:138).
This origin is preserved through Mojo IPC to the browser process. In content/browser/android/app_web_message_port.cc:159, the Accept method deserializes the message and has access to the correct sender_origin. However, the JNI transition to the Java layer at app_web_message_port.cc:182 fails to pass this origin metadata, leaving the Java PostMessageHandler to rely on the inaccurate WebContents URL.
Potential Impact
An attacker can exploit this origin confusion to impersonate a trusted origin to a host application. If the host application grants sensitive capabilities (e.g., access to local data, execution of native commands, or OAuth token relaying) based on the POST_MESSAGE_ORIGIN extra, a malicious iframe can drive those capabilities under the guise of the trusted main frame.
Potential Steps to Reproduce
- Host App Setup: Create an Android app that connects to
CustomTabsServiceand requests apostMessagechannel forhttps://trusted.example. InonPostMessage, log thePOST_MESSAGE_ORIGINextra. - Trusted Page Setup: Serve a page at
https://trusted.examplethat receives theMessagePortand transfers it to a cross-origin iframe (https://evil.example). - Attacker Payload: From the iframe, send a message:
port.postMessage("PAYLOAD"). - Observation: The host app will receive the message with the origin label
https://trusted.example, despite the message originating fromhttps://evil.example.
Suggested Fix
- Modify the JNI signature of
AppWebMessagePort.onMessageto include aString senderOriginparameter. - Update
content/browser/android/app_web_message_port.ccto extract thesender_originfrom theblink::TransferableMessageand pass it to the JNI call. - Update
PostMessageHandler.javato use the origin provided by theMessagePortcallback rather than queryingmWebContents.getMainFrame().getLastCommittedURL().
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
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
The Java handler derives the message origin from the current main-frame URL instead of using the sender origin that the C++ layer already tracks and fails to pass across JNI.
Impact
A malicious iframe could drive sensitive host-app capabilities that are gated on the reported origin, such as local data access, native command execution, or OAuth token relaying.
What the attacker needed
Host app uses POST_MESSAGE_ORIGIN for security decisions; trusted page transfers the port to an iframe; attacker controls the iframe content
The fix
The JNI callback should carry the sender origin from the C++ layer, and the Java handler should use that origin instead of the main-frame URL.
How it was found
- Create an Android app that connects to CustomTabsService and requests a postMessage channel for a trusted origin, logging the origin extra.
- Serve a page at the trusted origin that receives the MessagePort and transfers it to a cross-origin iframe.
- From the iframe, send a message through the port.
- Observe that the host app receives the message labelled with the trusted origin instead of the iframe's origin.
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.
Chrome Custom Tabs let an Android app open a web page and talk to it. The app trusts the page's address to decide if a message is safe. Here, a page can pass its messaging channel to another website, and Chrome still labels messages from that other site with the first page's address, so the app is fooled.
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.