- by x32x01 ||
An Android app with more than 10 million downloads could potentially expose a user's home address through a single tap on a malicious link. The issue involves a combination of an exported Activity, an insecure WebView, and an exposed JavaScript interface.
I was looking for Activities combining these characteristics:
I found a Deep Link that opened a screen accepting a URL parameter.
After examining the code, I found that the url parameter was loaded into a WebView without proper host validation or an allowlist.
This meant the WebView could potentially load an attacker-controlled webpage.
By itself, this behavior could create phishing or navigation risks. However, the more serious issue appeared when I examined how the WebView was configured.
This mechanism allows JavaScript running inside a WebView to interact with exposed methods in the Android application.
The problem was that the interface was available to webpages loaded into the WebView without adequate origin restrictions.
After reviewing the exposed methods, I found one called
The interface returned an empty object because no real location information was available.
To validate the data flow without accessing anyone's private information, I used Frida in the test environment to simulate a response containing a fictional address and coordinates.
This allowed me to demonstrate the behavior without retrieving real user location data.
When auditing Android applications, pay particular attention to the relationship between:
The original technical write-up:
The Delivery App That Told Strangers Where You Live: Anatomy of a Deep Link + WebView + JavaScript Interface Vulnerability
--------------------------------------------
🔎 Step 1: Finding the Deep Link Entry Point
While testing an Android delivery app, I decompiled its APK and inspected theAndroidManifest.xml file.I was looking for Activities combining these characteristics:
exported="true"BROWSABLEintent filter- A custom URI scheme
I found a Deep Link that opened a screen accepting a URL parameter.
🔗 Step 2: An Unrestricted WebView
The Activity accepted a link similar to this:myapp://popupview?url=...After examining the code, I found that the url parameter was loaded into a WebView without proper host validation or an allowlist.
This meant the WebView could potentially load an attacker-controlled webpage.
By itself, this behavior could create phishing or navigation risks. However, the more serious issue appeared when I examined how the WebView was configured.
⚠️ Step 3: From WebView to Sensitive Data
The application registered a JavaScript interface using:addJavascriptInterface(bridge, "nativeBridge")This mechanism allows JavaScript running inside a WebView to interact with exposed methods in the Android application.
The problem was that the interface was available to webpages loaded into the WebView without adequate origin restrictions.
After reviewing the exposed methods, I found one called
getUserLocation, which reportedly returned location information associated with the user's saved address, including:- GPS coordinates.
- City and neighborhood.
- ZIP code.
- Saved address details.
🔗 How the Vulnerability Chain Worked
The vulnerability involved multiple components working together:1. External Deep Link
An external link opens the app's vulnerable Activity.2. WebView Loads Untrusted Content
The Activity loads a webpage without adequately validating its destination.3. JavaScript Interface Exposure
The webpage can interact with the exposed native interface.4. Sensitive Location Data
An exposed method could return the user's saved location information.🧪 How I Tested It Without Accessing Real User Data
I performed the testing using an Android emulator and an empty account.The interface returned an empty object because no real location information was available.
To validate the data flow without accessing anyone's private information, I used Frida in the test environment to simulate a response containing a fictional address and coordinates.
This allowed me to demonstrate the behavior without retrieving real user location data.
🛡️ What Android Developers Should Fix
To prevent this type of vulnerability:- Validate Deep Link parameters before processing them.
- Restrict WebView navigation to trusted domains using an explicit allowlist.
- Avoid exposing sensitive native functionality through JavaScript interfaces.
- Never expose privileged interfaces to untrusted webpages.
- Review exported Activities and their intent filters.
- Require appropriate authorization before accessing sensitive user data.
🎯 Lessons for Mobile Security Researchers
A seemingly minor Deep Link issue can become much more serious when combined with an insecure WebView and an exposed native interface.When auditing Android applications, pay particular attention to the relationship between:
- exported
- BROWSABLE
- addJavascriptInterface
The original technical write-up:
The Delivery App That Told Strangers Where You Live: Anatomy of a Deep Link + WebView + JavaScript Interface Vulnerability
--------------------------------------------
Last edited: