Race condition in WebAppInstalls (CVE-2026-79117)
A timing race in Trusted Web Activity file handling leaves launch parameters dangling after the initial navigation, and a later navigation to an attacker origin adopts them without a URL check. The attacker's page then receives a FileSystemFileHandle with auto-granted read/write access to the user's shared file.
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. 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 timing race during Trusted Web Activity (TWA) intent handling causes file launch parameters to be populated asynchronously after the initial navigation begins. A malicious origin can hijack these stale, dangling parameters on a subsequent navigation, bypassing missing scope checks to receive an auto-granted read/write FileSystemFileHandle.
Affected files:
chrome/browser/android/webapps/twa_launch_queue_tab_helper.ccchrome/browser/android/webapps/twa_launch_queue_delegate.cccomponents/webapps/browser/launch_queue/launch_queue.ccchrome/browser/android/webapps/web_app_launch_handler.ccchrome/android/java/src/org/chromium/chrome/browser/customtabs/content/WebAppLaunchHandler.javachrome/android/java/src/org/chromium/chrome/browser/customtabs/content/DefaultCustomTabIntentHandlingStrategy.java
Estimated timestamp from git blame: Unknown (Google3 checkout)
Summary
A potential vulnerability in the Trusted Web Activity (TWA) file handling logic allows a malicious website to obtain FileSystemFileHandle objects (with auto-granted read/write access) that were intended for a different, verified TWA origin.
This occurs due to a combination of a timing race where launch parameters are populated asynchronously after navigation starts, a failure to verify the URL of the navigation handle when attaching stale parameters, and missing scope enforcement in production builds.
Technical Details
1. The Timing Race (Java)
When a TWA is launched with a file intent, DefaultCustomTabIntentHandlingStrategy.handleInitialIntent creates a WebAppLaunchHandler and initiates Digital Asset Link (DAL) verification asynchronously via mVerifier.verify(launchParams.targetUrl).then(...) (in WebAppLaunchHandler.maybeNotifyLaunchQueue).
Because Chromium's org.chromium.base.Promise.then() always posts callbacks to the message loop (even if the promise is already fulfilled), the JNI callback notifyLaunchQueue is queued. Meanwhile, handleInitialIntent synchronously starts the initial navigation to the TWA origin (mNavigationController.navigate(...)).
By the time JNI_WebAppLaunchHandler_NotifyLaunchQueue is called and populates pending_launch_params_ in C++, the intended navigation's DidStartNavigation event has already fired, missing the parameters. The parameters are left dangling.
2. Blind Parameter Attachment (C++)
In chrome/browser/android/webapps/twa_launch_queue_tab_helper.cc, DidStartNavigation blindly attaches any existing pending_launch_params_ to the next primary main frame navigation without verifying the URL:
void TwaLaunchQueueTabHelper::DidStartNavigation(content::NavigationHandle* handle) {
if (handle->IsInPrimaryMainFrame() && pending_launch_params_) {
TwaLaunchNavigationHandleUserData::CreateForNavigationHandle(
*handle, std::move(*pending_launch_params_));
pending_launch_params_.reset();
}
}
If the TWA page loads and then navigates to an attacker-controlled origin, DidStartNavigation for the attacker origin will adopt these stale parameters.
3. Missing Scope Enforcement and Auto-Granted Permissions
When the attacker navigation commits, LaunchQueue::Enqueue receives the parameters. It attempts to check scope:
DCHECK(delegate_->IsInScope(launch_params, launch_params.target_url()))
However, DCHECKs are stripped in release builds. Furthermore, TwaLaunchQueueDelegate::IsInScope is a stub that currently returns true.
When LaunchQueue::SendLaunchParams runs, it uses EntriesBuilder to construct the FileSystemAccessEntry. Crucially, EntriesBuilder builds its BindingContext using launch_params.target_url() (the verified TWA origin), not the attacker's current_url. It calls CreateFileEntryFromPath with UserAction::kSave, which bypasses user prompts and unconditionally grants read/write access (via ChromeFileSystemAccessPermissionContext::GetWritePermissionGrant).
The Mojo WebLaunchService then delivers this fully authorized handle to the attacker's renderer.
Potential Attack Scenario
Note: These are suggested steps; our tooling has not run a live exploit.
- An attacker registers a malicious application that sets up a TWA for their own verified origin (
https://twa.example). - The attacker application sends an intent to launch the TWA, attaching a shared file URI (e.g.,
content://media/external/images/1). - The TWA launches. The initial navigation to
https://twa.examplestarts, missing the async-populated launch parameters. - The TWA page automatically navigates the main frame to a second attacker-controlled origin (
https://malicious.example). DidStartNavigationattaches the stale launch parameters to thehttps://malicious.examplenavigation.- The navigation commits, and the attacker's site receives a
FileSystemFileHandlewith full read/write access to the user's media file viawindow.launchQueue.setConsumer.
Suggested Fix
- Verify URL: In
TwaLaunchQueueTabHelper::DidStartNavigation, verify thathandle->GetURL()matchespending_launch_params_->target_url()before attaching the parameters. - Enforce Scope: Change the
DCHECKinLaunchQueue::EnqueueandLaunchQueue::SendLaunchParamstoCHECKor handle it gracefully, and properly implementTwaLaunchQueueDelegate::IsInScope. - Address Timing Race: Consider tracking the intended Navigation ID when parameters are queued from Java to avoid relying entirely on the next chronological navigation event.
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
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 launch parameters are populated asynchronously after the intended navigation starts, and the next navigation adopts them without checking its URL, while the scope check is only a debug assertion and the delegate's scope method is a stub returning true.
Impact
An attacker could obtain read/write access to a file the user shared with a TWA, without a user prompt; the report notes the exploit has not been run live.
What the attacker needed
Attacker-controlled Android app; victim shares a file with the TWA; TWA page navigates to attacker origin
The fix
The report suggests verifying the navigation URL against the launch parameters' target URL, enforcing the scope check in release builds, and tracking the intended navigation ID to avoid the timing race.
How it was found
- The attacker registers an app that sets up a TWA for their own verified origin.
- The app sends an intent to launch the TWA with a shared file URI attached.
- The initial navigation to the verified origin starts before the async launch parameters are populated.
- The TWA page navigates the main frame to a second attacker-controlled origin.
- The stale launch parameters are attached to that navigation.
- The attacker's site receives a FileSystemFileHandle with read/write access to the user's media file.
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.
A Trusted Web Activity is a way for an Android app to open a website in a Chrome tab with special privileges, such as access to a file the user shared. Here the code that hands over that file access runs slightly late, so the file permission is left waiting and gets attached to whatever page loads next. If that next page belongs to an attacker, it can receive read and write access to the user's file without asking.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.