Insufficient validation of untrusted input in WebAppInstalls (CVE-2026-13852)
Chrome for Android's C++ path validation for content URIs uses a simple prefix match that can be bypassed by prepending a multi-user user ID prefix (e.g., '0@') to the authority, while Android's ContentResolver strips this prefix and resolves the URI to Chrome's private FileProvider. A co-installed malicious app could potentially gain read/write File System Access handles to sensitive internal files via a Trusted Web Activity.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 20 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 in Chrome for Android may allow a co-installed malicious app to bypass sensitive path checks for content URIs. By prepending a multi-user user ID prefix (e.g., '0@'), an attacker can bypass Chrome's C++ validation checks while the underlying Android ContentResolver resolves the URI to Chrome's own private, non-exported FileProviders. This potentially grants the attacker's Trusted Web Activity read/write File System Access handles to sensitive internal files.
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
Description
A potential logical parser differential between Chromium's C++ path validation and Android's ContentResolver URI parsing can allow a co-installed malicious app to bypass sensitive path checks for content URIs.
By prepending a multi-user user ID prefix (e.g., 0@ or 10@) to a content URI's authority, the URI fails to match Chrome's C++ prefix-based blocklist checks, while the underlying Android ContentResolver still successfully resolves the URI to Chrome's private, non-exported FileProvider endpoints. This can potentially grant an attacker's Trusted Web Activity (TWA) read/write File System Access (FSA) handles to sensitive internal files.
Root Cause
In chrome/browser/android/webapps/twa_launch_queue_delegate.cc, IsSensitivePath() performs a simple string prefix match to block Chrome's own private content URIs:
// chrome/browser/android/webapps/twa_launch_queue_delegate.cc
bool IsSensitivePath(const base::FilePath& path) {
if (path.IsContentUri()) {
std::string package_name = base::android::apk_info::package_name();
std::string chrome_content_prefix =
base::StrCat({"content://", package_name, "."});
std::string decoded_path = base::UnescapeBinaryURLComponent(
path.value(), base::UnescapeRule::NORMAL);
return base::StartsWith(decoded_path, chrome_content_prefix,
base::CompareCase::INSENSITIVE_ASCII);
}
return true;
}
Similarly, chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc performs an identical prefix match in CheckPathAgainstBlocklist():
// chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
if (path_info.path.IsContentUri()) {
std::string decoded_path = base::UnescapeBinaryURLComponent(
path_info.path.value(), base::UnescapeRule::NORMAL);
std::move(callback).Run(base::StartsWith(
decoded_path,
base::StrCat({"content://", base::android::apk_info::package_name(), "."}),
base::CompareCase::INSENSITIVE_ASCII));
return;
}
When a URI such as content://[email protected]/passwords/exported.csv is validated:
IsContentUri()returnstruebecause it checks for thecontent://scheme.base::StartsWithcomparescontent://[email protected]...againstcontent://com.android.chrome....- Because of the
0@multi-user prefix, the comparison fails and the validation returnsfalse(meaning the path is not blocked).
When Chrome attempts to read or write to this URI, the Java-side ContentUriUtils.java calls the Android system ContentResolver:
ContentResolver resolver = ContextUtils.getApplicationContext().getContentResolver();
Uri uri = Uri.parse(uriString);
afd = resolver.openAssetFileDescriptor(uri, mode);
At this point, the Android system ContentResolver normalizes the authority by stripping the userId prefix (using ContentProvider.getAuthorityWithoutUserId("[email protected]")), which evaluates to com.android.chrome.FileProvider. Since the call originates from Chrome itself, Android's ContentProvider permissions are satisfied, allowing Chrome's own non-exported FileProvider to resolve and return the requested file descriptor to the calling context.
Potential Trigger Steps
Note: These steps are based on static code analysis; our tooling does not currently run live exploit tests.
- A co-installed malicious app is configured to host a Digital Asset Links verification file matching its own origin (e.g.,
https://attacker.example) so that TWA origin verification succeeds. - The malicious app fires an intent to Chrome with
EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITYand addsEXTRA_FILE_HANDLING_DATAcontainingUri.parse("content://[email protected]/passwords/exported.csv"). - Chrome processes the intent and launches the TWA.
WebAppLaunchHandlerprocesses the launch parameters. - Due to the prefix mismatch (
0@),IsSensitivePathpermits the URI to proceed. - The file handle is delivered to the TWA's renderer via
WebLaunchServicewithUserAction::kSave(which auto-grants read and write permissions on Android). - The attacker's JavaScript in the TWA requests file access via
handle.getFile(), causing Chrome's browser process to open the content URI usingContentResolver, stripping the0@prefix and retrieving a file descriptor to Chrome's sensitive internal file, which is then exposed to the attacker's web origin.
Suggested Fix
To prevent this bypass, Chrome should canonicalize or strip multi-user user ID prefixes from content URIs prior to performing prefix comparisons.
In both C++ files (chrome/browser/android/webapps/twa_launch_queue_delegate.cc and chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc), the authority component of the content URI should be parsed and checked for the presence of an @ character. If an @ character is found in the authority segment of the content URI, the segment preceding the @ (inclusive) should be stripped before verifying the prefix. Alternatively, Java-side validation can be introduced using ContentProvider.getUriWithoutUserId() to sanitize URIs before they flow into the native validation code.
Evaluated with Chrome root at commit: b2fea2e31df308d0f04e4ae47def4c4f939ee141
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 C++ validation uses a simple string prefix match on the content URI without normalising or stripping the multi-user user ID prefix that Android's ContentResolver later removes.
Impact
A co-installed malicious app could potentially gain read/write File System Access handles to Chrome's sensitive internal files via a Trusted Web Activity, though the report notes the steps are based on static analysis and no live exploit was run.
What the attacker needed
Co-installed malicious app; app hosts Digital Asset Links file; TWA origin verification succeeds; victim has Chrome for Android
The fix
Chrome should canonicalize or strip multi-user user ID prefixes from content URIs before performing prefix comparisons, or use Java-side validation with ContentProvider.getUriWithoutUserId().
How it was found
- A co-installed malicious app hosts a Digital Asset Links verification file matching its own origin so that TWA origin verification succeeds.
- The malicious app fires an intent to Chrome with EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY and adds EXTRA_FILE_HANDLING_DATA containing a content URI with a '0@' prefix.
- Chrome processes the intent and launches the TWA; WebAppLaunchHandler processes the launch parameters.
- Due to the prefix mismatch, IsSensitivePath permits the URI to proceed.
- The file handle is delivered to the TWA's renderer via WebLaunchService with UserAction::kSave, which auto-grants read and write permissions on Android.
- The attacker's JavaScript in the TWA requests file access via handle.getFile(), causing Chrome's browser process to open the content URI using ContentResolver, stripping the '0@' prefix and retrieving a file descriptor to Chrome's…
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 on Android checks whether a file path points to its own private storage by comparing the start of the path string. Android also allows a user ID prefix like '0@' before the app name, which Chrome's check does not account for. A malicious app installed on the same phone could craft a special file path that Chrome thinks is safe but Android still resolves to Chrome's private files, potentially letting the attacker read or write them.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.