Skip to content
OAuth / SSO Write-up Intermediate

TALE OF A VULNERABILITY WHICH LEADS TO ACCOUNT TAKEOVER OF GOVERN

An Android app returned the OAuth token to the app through a custom deep link that was not restricted to the legitimate app, so any installed app registering the same scheme and host could receive the token. An attacker could therefore capture a victim's OAuth token and take over the account.

Karthikeyan.V Follow

Published on medium.com

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

Karthikeyan.V, on medium.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 used a custom deep link to deliver the OAuth token without verifying the caller through Android App Links (the assetlinks.json file), so any app could register the same scheme and host.

Impact

An attacker who gets the token could take over the victim's account, though the write-up only claims a high possibility rather than demonstrating a full takeover.

What the attacker needed

Victim installs a malicious app; victim logs in via OAuth; app lacks assetlinks.json

The fix

The app should publish the .well-known/assetlinks.json file on its authorised domain so the deep link is bound to the legitimate app, and OAuth should complete inside the app rather than through an unverified link.

How it was found

  1. Log in to the app with the Microsoft OAuth option and note that it opens the mobile browser.
  2. Check whether the app's domain serves the .well-known/assetlinks.json file.
  3. Build a test app that registers the same deep link scheme and host.
  4. Repeat the OAuth login and observe the test 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 Google or Microsoft, the browser sends you back to the app using a special link that starts with the app's own name, called a deep link. If the app does not prove which app is allowed to receive that link, another app on the phone can claim the same name and quietly receive the login token. Whoever holds that token can act as the victim.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by Karthikeyan.V

View all

21 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.