1-Click Account Takeover via Misconfigured WebView
An Android retail app exposed a WebView through a deep link that accepted any URL scheme, including javascript:, and forwarded the user's Authorization header to whatever URL it loaded. An attacker could send a single link to a victim and capture their authentication token, leading to account takeover.
Published on abdelnasserr.medium.com
The app had a WebView activity that could be triggered from outside the app through a custom URI scheme:
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
Impact
An attacker could achieve account takeover via a single link, with no required interaction beyond opening it.
What the attacker needed
Victim has the app installed; victim opens a link in a browser; attacker controls a server
The fix
Disable JavaScript in the WebView, validate the url parameter against an https-only allowlist of trusted domains, and never forward Authorization headers to external origins.
How it was found
- Set up a server to capture incoming HTTP requests and log all headers.
- Host an HTML page that redirects to the deep link with a javascript: payload.
- Send the page URL to a victim who has the app installed.
- Victim opens the link in any browser, triggering the deep link and WebView execution.
- Check server logs for the victim's Authorization header.
- Use the captured token to authenticate as the victim.
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 an app. This app let other apps or links open its WebView with any address, including special javascript: addresses that run code. Because the WebView also sent the user's login token to whatever address it loaded, an attacker could steal that token and act as the victim.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.