Skip to content
Account takeover Write-up Intermediate

Overlooked Android Vulnerability: OAuth custom scheme hijacking

The Android app returned the KYC login JWT through an unprotected custom URL scheme deep link, so any third-party app could register the same scheme and receive the token. An attacker could then use the stolen token to take over a victim's KYC account and impersonate them.

entropydrifter Follow

Published on entropydrifter.medium.com

In this writeup I’ll walk through How I achieved 2 KYC takeover and was able to Impersonate Legitimate customers for One of the Top Crypto Platforms and got rewarded a good Bounty.

Abdullah Ahmed aka EntropyDrifter, on entropydrifter.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

The app used a custom URL scheme for the KYC callback without verifying app-link ownership, so other apps could register the same scheme.

Impact

An attacker could steal the KYC JWT and take over the victim's KYC account, impersonating legitimate customers; the victim must pick the attacker's app in the chooser.

What the attacker needed

Victim installs the malicious app; victim completes KYC; victim picks attacker app in chooser

The fix

The callback should use verified Android App Links with autoVerify so only the legitimate app can receive the token.

How it was found

  1. Decompile the APK and inspect the manifest to find the KYC activity and its intent filter.
  2. Note that the callback uses a custom scheme with host kyc_result and no autoVerify.
  3. Build a malicious app that declares the same scheme and host with a high priority.
  4. Have the victim complete KYC, then choose the attacker app from the chooser.
  5. Capture the JWT from the callback link and use it to log in 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.

When you finish an identity check in an app, the app is handed a secret login token through a link. Android lets any installed app claim the same link name if the real app has not verified ownership of it. A malicious app can therefore catch that token and log in 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.

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.