UI misrepresentation in CustomTabs (CVE-2026-79180)
A logic flaw in Android WebAPK and Trusted Web Activity surfaces lets an attacker-chosen manifest theme colour persist after the page's security state drops to DANGEROUS without a navigation. The forced warning toolbar stays themed, the warning icon is tinted neutrally rather than red, and the URL scheme is not emphasised, weakening the warning.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 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: A potential vulnerability in Android WebAPK/TWA surface theme color handling can lead to security indicator degradation. When a page undergoes a post-commit security state downgrade to DANGEROUS without navigation, the custom branded theme color can persist on the toolbar. Consequently, the forced-visible toolbar remains themed, the warning icon is tinted neutrally instead of red, and URL scheme emphasis is disabled.
Affected files:
chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/BrowserServicesThemeColorProvider.javachrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.javachrome/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/TopUiThemeColorProvider.javachrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java
Estimated timestamp from git blame: 2022-01-17
Potential Security Indicator Degradation on Post-Commit Downgrade in WebAPK/TWA
Description
In Android WebAPK and Trusted Web Activity (TWA) surfaces, a potential logic flaw allows an attacker-controlled manifest theme_color to persist even after the page's security state is downgraded to DANGEROUS (e.g., due to loading an active subresource with certificate errors on a previously trusted domain).
Consequently, when the security toolbar is forced on-screen to warn the user, it remains themed with the attacker-chosen color, the SSL warning triangle icon is tinted with a neutral contrast color (grey or white) instead of warning red, and URL scheme emphasis is disabled. This significantly weakens the visual prominence of the DANGEROUS security warning.
Potential Root Cause Analysis
-
Short-Circuit in Theme Updates: When a tab's security state changes to
DANGEROUS, the SSL-to-theme bridge (TabThemeColorHelper.onSSLStateUpdated->TabImpl.updateThemeColor()) clamps the theme color toUNSPECIFIED_THEME_COLORsince theming is no longer allowed. However, if the page does not explicitly specify a<meta name="theme-color">tag, the currentmThemeColorinTabImplis alreadyTabState.UNSPECIFIED_THEME_COLOR(default value). As a result, the update inTabImpl.java(line 1956) short-circuits:Java // chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java void updateThemeColor(int themeColor) { if (!isThemingAllowed()) { themeColor = TabState.UNSPECIFIED_THEME_COLOR; } if (mThemeColor == themeColor) { // UNSPECIFIED_THEME_COLOR == UNSPECIFIED_THEME_COLOR (0 == 0) return; // Short-circuits; onDidChangeThemeColor is never fired } ... }Because it returns early,
onDidChangeThemeColoris never fired to notify the registered theme providers. -
Lack of SSL State Observers: Both
BrowserServicesThemeColorProviderandTopUiThemeColorProviderfail to listen directly foronSSLStateUpdatedevents in their respective tab observers (chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/BrowserServicesThemeColorProvider.javaline 89 andchrome/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/TopUiThemeColorProvider.javaline 72). SinceonDidChangeThemeColoris never fired, neither provider recalculates whether theming is allowed. -
Neutral Warning Tint and Lack of URL Emphasis: Because the theme providers fail to update,
LocationBarModel.mPrimaryColorretains the stale, attacker-provided WebAPK manifest color.- When the toolbar determines the warning icon tint in
LocationBarModel.getSecurityIconColorWithSecurityLevel()(chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.javaline 851), it calculates a branded color scheme (e.g.LIGHT_BRANDED_THEMEorDARK_BRANDED_THEME) instead ofBrandedColorScheme.APP_DEFAULT. Under branded schemes, it falls back to a neutral grey/white contrast tint (line 868) instead of the standard warning red (R.color.default_red). - Additionally,
LocationBarModel.shouldEmphasizeHttpsScheme()(line 597) returnsfalsebecause the system still reports that it is using a brand color (mIsUsingBrandColor == true), preventing the URL scheme from being emphasized.
- When the toolbar determines the warning icon tint in
Potential Steps to Trigger / Reproduce
Note: Since our automated tooling cannot run arbitrary code or execute interactive Android environments, the following are suggested/potential reproduction steps based on static analysis:
- Compile and install an Android WebAPK or TWA for a PWA that specifies
"theme_color": "#00aa00"(or another highly distinct color) in its manifest, but has no<meta name="theme-color">tag in its web pages. - From an external domain (e.g.,
https://cdn.attacker.test), serve an active subresource over TLS with an invalid certificate. Have the user proceed through the SSL certificate interstitial once (e.g., in Chrome) so that the certificate error is added to the local allowlist. - Open the installed WebAPK. The origin will verify, the toolbar will be hidden, and the status bar will be the manifest green color (
#00aa00). - Trigger the injection of the allowlisted insecure subresource (e.g.,
<script src="https://cdn.attacker.test/script.js"></script>) without executing a page navigation. - Observe that the TWA/WebAPK toolbar slides back into view to warn the user, but:
- The toolbar background is still green.
- The warning triangle icon is displayed but tinted white/grey instead of red.
- The HTTPS scheme is not emphasized.
Suggested Fix
Ensure that both TopUiThemeColorProvider and BrowserServicesThemeColorProvider listen to SSL/security state changes.
-
In
chrome/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/TopUiThemeColorProvider.java, addonSSLStateUpdatedtomTabObserverto triggerupdateColor():Java @Override public void onSSLStateUpdated(Tab tab) { if (tab != null) { updateColor(tab, tab.getThemeColor(), false); } } -
In
chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/BrowserServicesThemeColorProvider.java, addonSSLStateUpdatedtomTabObserverto triggerupdateTheme():Java @Override public void onSSLStateUpdated(Tab tab) { updateTheme(); }
Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379
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 theme update short-circuits when the clamped colour equals the existing unspecified default, so the change callback never fires and the theme providers, which do not observe SSL state directly, keep the stale branded colour.
Impact
The DANGEROUS security warning could be visually weakened, making it less likely a user notices the downgrade.
What the attacker needed
Victim installs a crafted WebAPK or TWA; victim accepts a certificate interstitial once; attacker controls a subresource host
The fix
The theme providers should also listen for SSL state changes and recompute the colour when the security state updates.
How it was found
- Install a WebAPK or TWA whose manifest sets a distinct theme colour but whose pages have no theme-color meta tag.
- Serve an active subresource with an invalid certificate and have the user accept the interstitial once so the error is allowlisted.
- Open the installed app so the origin verifies and the toolbar hides.
- Load the allowlisted insecure subresource without a page navigation.
- Observe the warning toolbar return still themed, with a neutral warning icon and no scheme emphasis.
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.
When a site's security goes bad, the browser is meant to show a clear red warning bar. Here the app kept the site's own chosen colour on that bar and showed a grey or white warning icon instead of red, so the warning looked less alarming. The report is based on reading the code, not on actually running it.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.