Skip to content
OAuth / SSO Write-up Intermediate

Account Takeover via Misconfigured OAuth in Android

Two Android apps using Auth0 had redirect URIs in their allowlist that no Android app owned, and the server did not enforce PKCE. An attacker could register the unclaimed URI in a malicious app, send a victim a login link, intercept the authorization code, and exchange it for tokens, leading to full account takeover.

medium.com

Published on medium.com

Both apps use Auth0 and a custom URI scheme as the OAuth redirect target. The attack works the same way in both cases — the attacker makes the victim install a malicious app via a phishing campaign, then sends them a crafted login link.

abdelnasser, 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 auth server allowed redirect URIs that were not registered by the legitimate Android app and did not enforce PKCE, so an attacker could register the unclaimed URI and intercept the authorization code.

Impact

Full account takeover on both apps, giving access token, refresh token, and ID token; the refresh token survives a password change.

What the attacker needed

Victim installs malicious app; victim clicks a crafted login link; victim logs in

The fix

Enforce PKCE server-side, remove any redirect URI from the allowlist that isn’t actively registered by the current Android app, give Android and iOS separate Auth0 clients with separate allowlists, and migrate to HTTPS App Links with autoVerify.

How it was found

  1. Build a malicious app that registers the unclaimed redirect URI.
  2. On launch, extract the authorization code from the incoming intent.
  3. Exchange the code at the token endpoint without a code verifier.
  4. Send the crafted login link to the victim.
  5. Victim taps the link and logs in; the callback goes to the malicious app, which exchanges the code for tokens.

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.

OAuth is a way for apps to let you log in with another service. The service sends a secret code back to the app using a special link. If the app doesn't properly claim that link, another app can claim it and steal the code. This report shows two cases where that happened, letting an attacker get tokens that give full access to the victim's account.

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.

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.