Insufficient validation of untrusted input in Custom Tabs (CVE-2026-11035)
Chrome's custom RemoteViews inflation for Custom Tabs night mode lacks the standard LayoutInflater filter, allowing any View subclass in Chrome's classpath to be instantiated from an attacker-supplied layout. A malicious Android app can force this path via a colour scheme mismatch and potentially instantiate arbitrary classes, leading to code execution in the browser process.
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: Chrome's manual RemoteViews inflation for Custom Tabs night mode omits a critical security filter, allowing arbitrary View instantiation. An untrusted Android application can supply a malicious RemoteViews payload and force this vulnerable code path via a CustomTabIntent color scheme mismatch. By chaining this with internal reflection gadgets like BaseOrdinalLegend, an attacker can potentially instantiate arbitrary classes and execute code within Chrome's highly privileged browser process.
Affected files:
chrome/browser/ui/android/night_mode/java/src/org/chromium/chrome/browser/night_mode/RemoteViewsWithNightModeInflater.javachrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.javachrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.javachrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
Estimated timestamp from git blame: 2019-05-29
Description
When a Custom Tab is launched with an EXTRA_REMOTEVIEWS payload to customize the bottom bar, Chrome attempts to inflate the provided layout. To address an Android bug related to night mode configuration overrides, Chrome implements a custom inflation fallback in RemoteViewsWithNightModeInflater.inflateWithEnforcedDarkMode().
However, this manual fallback omits a critical security mechanism present in standard Android RemoteViews.apply(): it fails to set a LayoutInflater.Filter. The standard filter ensures that only View classes explicitly annotated with @RemoteView (e.g., TextView, LinearLayout) can be instantiated from the untrusted layout XML. Because Chrome's implementation lacks this filter, any class extending View present in Chrome's classpath can be instantiated if it is referenced in an attacker-provided layout XML.
An unprivileged, malicious Android app can reliably trigger this vulnerable path by providing an EXTRA_COLOR_SCHEME in the CustomTabsIntent that intentionally mismatches the device's system-wide night mode setting (e.g., requesting dark mode when the system is in light mode). Because the CustomTabIntentDataProvider parses these extras without signature validation or first-party trust checks, any app can force Chrome's browser process to evaluate isInLocalNightMode == isInSystemNightMode as false, triggering the inflateWithEnforcedDarkMode() fallback.
Potential Impact
By supplying a crafted XML layout, an attacker can instantiate arbitrary View subclasses within Chrome's highly privileged browser process. This can lead to a sandbox escape or local privilege escalation. For instance, instantiating <android.webkit.WebView> could allow cross-origin requests or local file access.
More critically, the attacker can leverage internal Chrome classes as gadgets. For example, <org.chromium.chrome.browser.chart.common.legend.BaseOrdinalLegend> contains a highly dangerous reflection primitive in its constructor:
String rowProviderClassName = a.getString(R.styleable.AplosLegend_aplosRowProviderClass);
// ...
Class<?> clazz = Class.forName(rowProviderClassName);
// ... searches for constructors and invokes newInstance()
By setting the app:aplosRowProviderClass XML attribute to an arbitrary fully qualified class name, the attacker can force the browser process to call Class.forName().newInstance() on that class. This allows the execution of arbitrary static initializers and constructors for any class in Chrome's extensive classpath.
Hypothetical Attack Scenario
Note: These are suggested steps based on static code analysis; our tooling agent does not yet have the capability to execute this code to verify a full exploit chain.
- Attacker Setup: A malicious Android application is installed on the victim's device alongside Chrome.
- Payload Creation: The malicious app creates an XML layout resource containing a gadget tag, such as
<org.chromium.chrome.browser.chart.common.legend.BaseOrdinalLegend aplosRowProviderClass="com.example.DangerousClass" />. - Intent Construction: The app constructs an
Intentto launch a Custom Tab. - Forcing Mismatch: The app adds the
CustomTabsIntent.EXTRA_COLOR_SCHEMEextra, explicitly setting it to a value that opposes the current system night mode (e.g.,COLOR_SCHEME_DARKif the system is light). - Attaching Payload: The app creates a
RemoteViewsobject pointing to its malicious layout and attaches it viaCustomTabsIntent.EXTRA_REMOTEVIEWS. - Trigger: The app fires the Intent.
- Exploitation: Chrome parses the Intent, detects the night mode mismatch, and routes the
RemoteViewsinflation to the unfilteredRemoteViewsWithNightModeInflater. TheLayoutInflaterparses the attacker's XML, instantiatesBaseOrdinalLegendusing Chrome's ClassLoader, and triggers the reflection gadget, executing the attacker's chosen constructor in the browser process.
Suggested Fix
Ensure that the manual LayoutInflater created in RemoteViewsWithNightModeInflater.inflateWithEnforcedDarkMode() enforces the same security restrictions as the standard Android framework. Specifically, a LayoutInflater.Filter must be applied to the inflater instance before calling inflater.inflate(). This filter should explicitly verify that any requested class is annotated with android.widget.RemoteViews.RemoteView. Alternatively, consider restricting the EXTRA_REMOTEVIEWS functionality exclusively to trusted, first-party applications.
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
The custom inflater used for night mode does not apply a LayoutInflater.Filter, so it fails to restrict instantiation to classes annotated with @RemoteView.
Impact
An attacker could instantiate arbitrary View subclasses and use reflection gadgets to execute code in Chrome's privileged browser process, potentially leading to sandbox escape or local privilege escalation.
What the attacker needed
Malicious Android app installed; victim has Chrome installed; no user interaction beyond app installation
The fix
The manual inflater should apply a LayoutInflater.Filter that only allows classes annotated with @RemoteView, or the EXTRA_REMOTEVIEWS feature should be restricted to trusted first-party apps.
How it was found
- Install a malicious Android app alongside Chrome.
- Create an XML layout containing a gadget tag such as BaseOrdinalLegend with a class name attribute.
- Build an Intent to launch a Custom Tab.
- Add a colour scheme extra that opposes the current system night mode.
- Attach a RemoteViews object pointing to the malicious layout via the extras.
- Fire the Intent so Chrome inflates the layout through the unfiltered night-mode inflater.
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 ask Chrome to show a custom bottom bar using a RemoteViews layout. Normally Android only allows certain safe view classes to be created from such layouts, but Chrome's special night-mode code forgot that check. A malicious app could therefore make Chrome create dangerous classes and run their code inside Chrome's powerful process.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.