Insufficient validation of untrusted input in WebAppInstalls (CVE-2026-13851)
Chrome's C++ code checks content-URI prefixes against raw bytes, while Android's ContentResolver decodes the authority, so a percent-encoded dot can bypass the blocklist. A malicious Trusted Web Activity could then read or write Chrome's internal FileProvider paths.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 28 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 potential parser differential between Chrome's raw-byte prefix checking and Android's ContentResolver URI parsing allows a bypass of content-URI blocklists. By percent-encoding the authority (e.g., using '%2E' instead of '.'), a malicious Trusted Web Activity (TWA) can potentially bypass Chrome's blocklist checks. This may enable a malicious TWA to obtain unauthorized read or write access to Chrome's internal FileProvider paths.
Affected files:
chrome/browser/android/webapps/twa_launch_queue_delegate.ccchrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
Estimated timestamp from git blame: 2024-09-04
Potential Security Issue Overview
There is a potential parser differential vulnerability in Chrome for Android that can allow a malicious Trusted Web Activity (TWA) to bypass content-URI blocklist checks.
Chrome prevents TWAs from opening Chrome's own internal content URIs by performing raw-string prefix checks in C++. However, when the URI is actually opened at the Java platform level, Android's ContentResolver decodes the authority component. This discrepancy allows percent-encoded authorities (e.g., %2E instead of .) to bypass C++ blocklist checks while still resolving to Chrome's own non-exported FileProviders.
Root Cause Analysis
In chrome/browser/android/webapps/twa_launch_queue_delegate.cc and chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc, Chrome checks if a path is sensitive by executing a raw-byte comparison against a prefix containing Chrome's package name followed by a dot:
// chrome/browser/android/webapps/twa_launch_queue_delegate.cc
if (path.IsContentUri()) {
std::string package_name = base::android::apk_info::package_name();
std::string chrome_content_prefix = base::StrCat({"content://", package_name, "."});
return base::StartsWith(path.value(), chrome_content_prefix, base::CompareCase::INSENSITIVE_ASCII);
}
If the package name is com.android.chrome, the expected prefix is "content://com.android.chrome.".
If a malicious app registers a TWA file-handling URI with a percent-encoded dot in the authority (e.g., content://com.android.chrome%2EFileProvider/downloads/victim.pdf), the comparison at base::StartsWith fails because character offset 28 contains % (0x25) instead of . (0x2E).
When Chrome later resolves the URI to open the file, it executes the JNI call ContentUriUtils.openContentUri (base/android/content_uri_utils.cc), which calls getAssetFileDescriptor inside ContentUriUtils.java:
Uri uri = Uri.parse(uriString);
...
afd = resolver.openAssetFileDescriptor(uri, mode);
Under Android OS specifications, ContentResolver extracts the provider authority using uri.getAuthority(), which explicitly returns the percent-decoded authority. Consequently, %2E decodes to ., yielding com.android.chrome.FileProvider. The request is successfully routed to Chrome's own internal FileProvider, bypassing the safety check.
Potential Attack Scenario
Note: Our tooling does not currently have the capability to execute code or run functional POCs. The steps below represent a theoretical, potential sequence of events based on static code analysis.
- A co-installed malicious app
com.evil.twahosts Digital Asset Links verification metadata forhttps://evil.exampleto establish TWA trust. - The app fires a TWA intent with a percent-encoded file URI in
EXTRA_FILE_HANDLING_DATAtargeting:content://com.android.chrome%2EFileProvider/downloads/victim.pdf - Chrome verifies the TWA trust and notifies the launch queue via JNI without normalizing or URL-decoding the input.
- C++ blocklist checks verify the raw string against
"content://com.android.chrome."and miss the match because of the%2Eencoding. - The file handle is granted to the renderer with write permissions (
UserAction::kSavepolicy). - The renderer uses the handle to write or read data. This request is mapped to
ContentUriUtils.javain the browser process. - The Android OS decodes the authority to
com.android.chrome.FileProviderand grants access because the requester runs under the same UID (confused deputy bypass ofexported="false").
Suggested Fix
Before executing prefix validation on Content URIs in C++, Chrome should normalize the paths. Alternatively, the validation check should occur on a decoded or parsed representation of the authority.
For instance, we can decode percent-encoded sequences in the C++ string before verifying prefixes, or parse the URI via a robust URI parser (such as GURL or a utility that mirrors Android's decoding logic) and match against the decoded host/authority component.
Evaluated with Chrome root at commit: 9ebf4302210513a012c901d87a2668b3aadf8cc1
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 blocklist check compares the raw, still-encoded URI string against a prefix, while Android's ContentResolver decodes the authority before routing, so the two disagree on what the URI means.
Impact
A malicious TWA could potentially obtain unauthorised read or write access to Chrome's internal FileProvider paths, though the report is theoretical and no working proof of concept was executed.
What the attacker needed
Malicious app co-installed on device; TWA trust via Digital Asset Links; victim uses Chrome on Android
The fix
Chrome should normalise or decode content URIs before prefix validation, or parse the URI and match against the decoded authority.
How it was found
- A co-installed malicious app hosts Digital Asset Links metadata to establish TWA trust.
- The app fires a TWA intent with a percent-encoded file URI in EXTRA_FILE_HANDLING_DATA.
- Chrome verifies TWA trust and passes the URI to the launch queue without normalising it.
- The C++ blocklist check misses the match because of the percent encoding.
- The file handle is granted to the renderer with write permissions.
- Android decodes the authority and grants access to Chrome's internal FileProvider.
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 tries to stop web apps from touching its own private files by checking the start of a file address. But Android later decodes special characters in that address, so a cleverly encoded address slips past the check and reaches the private files.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.