The Bridge Between a Web Page and the Phone Itself: Abusing an An
The Android app exposed a JavaScript bridge with methods to read the user's authentication token, download arbitrary files, and trigger native navigation, with no restriction on which web content could call it. Because a third-party chat widget was loaded in the same WebView, any compromise of that widget could let an attacker extract tokens and take over accounts.
Hybrid mobile apps occupy an unusual security position: part native application, part embedded web browser, with a deliberate bridge connecting the two so that web content running inside the app can trigger native device functionality — things no ordinary website could ever do, like reading contacts, accessing the…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The app attached a powerful JavaScript bridge to a WebView that accepted any URL and also loaded third-party chat widget code, so untrusted web content could call native methods that expose the session token.
Impact
Any compromise or malicious update of the third-party chat widget, or any future untrusted content loaded in this WebView, could extract a user's authentication token and achieve full account takeover, independent of the app owner's own security.
What the attacker needed
Android app with a WebView and JS bridge; Third-party chat widget loaded in same WebView; Attacker controls or compromises that widget
The fix
The app removed the token method from the bridge, restricted WebView navigation to an explicit first-party allowlist, and isolated the third-party chat widget into its own bridge-free WebView instance.
How it was found
- Decompile the app's APK and read the native code to find the exposed JavaScript bridge and its methods.
- Check the WebView configuration and confirm it applies no origin restriction on loaded content.
- Build a minimal test page that replicates the chat widget's loading context and calls the bridge's token method.
- Load the test page in the app's WebView on a controlled device under a test account and observe the returned token.
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 write-up has not been written yet. The Original tab links to the source.
A WebView is a mini browser built into a mobile app. The app gave any web page shown inside it a direct line to native phone features, including a way to read the user's login token. Since a chat widget from another company ran in the same space, a problem in that widget could let someone steal the token and log in as the user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.