Bounty Of An Insecure Webview Part 1 Xss But With Steroids
An exported WebView activity in an Android app accepted an unvalidated URL from an intent, allowing any app to load arbitrary web content. Because JavaScript was enabled, an attacker could execute JavaScript in the WebView, including on any domain via a second intent, achieving universal XSS.
Published on infosecwriteups.com
We all love our mobile apps, right? They make life easier, more fun, and keep us connected.
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 exported WebView activity did not validate the URL passed via intent extras and enabled JavaScript, allowing arbitrary URL loading and script execution.
What the attacker needed
Victim installs malicious app; target app installed
How it was found
- Decompile the APK and inspect AndroidManifest.xml to find the exported WebViewActivity.
- Use adb to start the activity with a test URL in the 'key.url' extra and confirm it loads.
- Build a proof-of-concept app that sends an intent with a 'javascript:' URL to the activity.
- Observe JavaScript execution in the WebView.
- Send a second intent after a delay to load a 'javascript:' URL on an already loaded page, achieving universal XSS.
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 inside a mobile app. The app left a screen that shows web pages open to other apps and did not check which web address it was given. So another app could make it open a malicious page or run harmful code.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.