Skip to content
Account takeover Write-up Intermediate

Tale Of A Vulnerability Which Leads To Account Takeover Of Government Android Application

An Android app's OAuth login flow returned the user's token through a custom deep link that any installed app could register for, because the app's domain did not publish an assetlinks.json file. A malicious app claiming the same scheme and host could receive the token and take over the victim's account.

cappriciosecurities Follow

Published on infosecwriteups.com

I REQUEST YOU TO READ MY PREVIOUS BLOGTO UNDERSTAND THE WORKING PRINCIPLE OF THIS VULNERABILITY.

cappriciosecurities, on infosecwriteups.com

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

Likely the app relied on a custom deep link to deliver the OAuth token without verifying link ownership via assetlinks.json, so any app could register the same scheme and host.

Impact

A malicious app installed on the device could capture the OAuth token and take over the victim's account.

What the attacker needed

Victim installs a malicious app; victim logs in via OAuth

The fix

The app should publish a .well-known/assetlinks.json file on its authorised domain so that only the legitimate app can handle the OAuth deep link.

How it was found

  1. Log in to the app with OAuth and observe that a mobile browser is opened.
  2. Check whether the assetlinks.json file exists on the app's domain.
  3. Build a malicious app that registers the same deep link scheme and host.
  4. Repeat the OAuth login and observe the malicious app receiving the 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.

When you log in with a service like Microsoft, the app is reopened through a special link that carries your login token. Android lets any app claim a link if the real owner has not published a verification file on its website. A fake app could claim that link, receive your token, and act as you.

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.

More by cappriciosecurities

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.