Insufficient validation of untrusted input in WebView (CVE-2026-17741)
Android WebView's default external navigation handler parses intent:// URIs without sanitising Intent flags, so a malicious website can set URI permission grant flags. An attacker-controlled app could then gain read and write access to the host app's private files exposed through a FileProvider.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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 without the security team.
Overview: Android WebView's default external navigation handler fails to sanitize Intent flags parsed from intent:// URIs. A malicious website can leverage this to grant a local attacker-controlled application read and write access to the host app's private files. This potentially allows a full bypass of the Android application sandbox if the host app uses a FileProvider.
Affected files:
android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
Estimated timestamp from git blame: 2025-06-20
Description
In Android WebView, if an embedding application does not set a custom WebViewClient, external navigations are handled by the default AwContentsClient.sendBrowsingIntent method. This method uses Intent.parseUri to construct an Android Intent from an intent:// URI.
While the method sanitizes the Intent's component, category, and selector to prevent certain types of exploitation, it completely fails to sanitize the Intent's flags. The Android framework's Intent.parseUri explicitly parses the launchFlags fragment parameter and applies it to the intent.
By injecting flags such as Intent.FLAG_GRANT_READ_URI_PERMISSION (0x1) and Intent.FLAG_GRANT_WRITE_URI_PERMISSION (0x2), a malicious website can force the host application to fire an intent that delegates access to its own private content:// URIs (such as those exposed by a FileProvider). Because the Intent is fired from the host application's Activity context, the Android OS correctly attributes the Intent to the host app and honors the URI permission grant, inadvertently giving the attacker-specified target application full access to the host's private files.
Potential Attack Steps
Note: These are potential steps based on code analysis; a working Proof of Concept has not been executed.
- Preconditions: A victim application uses a
WebViewwithout setting a customWebViewClientand implements aFileProviderwithgrantUriPermissions="true"(a common configuration for sharing files). - Attacker Setup: The attacker publishes a malicious companion app (e.g.,
com.attacker.app) which the victim installs. - Execution: The victim visits the attacker's malicious website inside the victim application's WebView.
- Bypass User Gesture: The attacker's server responds with an HTTP 302 redirect. This automatically bypasses the
hasUserGesturecheck inAwContentsClient.sendBrowsingIntent. - Crafted Payload: The redirect target is a crafted URI targeting the victim's FileProvider:
intent://com.victim.fileprovider/internal_data.db#Intent;scheme=content;launchFlags=0x3;package=com.attacker.app;end - Privilege Escalation:
sendBrowsingIntentparses the URI, applyinglaunchFlags=0x3(Read and Write URI Permissions). It then callscontext.startActivity(intent)using the victim app's context. - Data Compromise: The Android OS launches
com.attacker.app, explicitly granting it read and write permissions tointernal_data.db. The attacker app can now silently exfiltrate or modify the victim app's private data, achieving a sandbox escape.
Suggested Fix
Implement Intent flag sanitization in AwContentsClient.sendBrowsingIntent before calling startActivity. This should mirror the protection already present in Chrome's ExternalNavigationHandler.sanitizeQueryIntentActivitiesIntent, which masks flags against a safe allowlist:
intent.setFlags(intent.getFlags() & ALLOWED_INTENT_FLAGS);
The ALLOWED_INTENT_FLAGS list must strictly exclude URI permission granting flags (FLAG_GRANT_READ_URI_PERMISSION, FLAG_GRANT_WRITE_URI_PERMISSION, FLAG_GRANT_PERSISTABLE_URI_PERMISSION, and FLAG_GRANT_PREFIX_URI_PERMISSION).
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
Results 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 default WebView external navigation handler parses intent:// URIs and sanitises the component, category and selector but does not strip URI permission grant flags from the Intent.
Impact
An attacker-controlled app could gain read and write access to the host app's private files, potentially bypassing the Android application sandbox; the report notes that a working proof of concept has not been executed.
What the attacker needed
Victim app uses default WebViewClient; victim app has FileProvider with grantUriPermissions; victim installs attacker's app; victim visits attacker's website in the app
The fix
The handler should mask Intent flags against a safe allowlist that excludes URI permission granting flags before calling startActivity.
How it was found
- The victim app uses a WebView without a custom WebViewClient and has a FileProvider with grantUriPermissions enabled.
- The attacker publishes a malicious companion app that the victim installs.
- The victim visits the attacker's website inside the victim app's WebView.
- The attacker's server responds with an HTTP 302 redirect to bypass the user gesture check.
- The redirect target is a crafted intent:// URI that includes launchFlags for read and write URI permissions and names the attacker's package.
- The WebView parses the URI and starts the attacker app with the granted permissions, allowing it to read or modify the victim's private 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.
Android apps can share files with other apps through a component called a FileProvider. When a WebView opens a special intent:// link, it builds an Android Intent, and the code did not clean up permission flags in that link. A malicious site could therefore tell the phone to give an attacker's app access to the victim app's private files.
What is Mobile?
Flaws specific to Android and iOS apps: exported components, deep links, WebViews and data left on the device.