Skip to content
Account takeover Write-up Intermediate

A One Click Account Takeover When An Android Deep Link Hands Your Session To An Attacker

An Android app's deep-link router accepted an attacker-supplied URL parameter as a navigation target without validating its host, and on one route it wrote the user's live session cookie onto that attacker-controlled host before loading it in a WebView. An attacker could send a genuine brand link that, when tapped, delivered the victim's session token to the attacker, enabling full account takeover.

nav1n👨🏻‍💻⚠️ Follow

Published on infosecwriteups.com

A large e-commerce Android app exposed a deep-link router that read a URL parameter from the tapped link and, without validating its scheme or host, used it as the app’s in-app navigation target. For one particular in-app route, the app wrote the user’s live session cookie onto that attacker-supplied URL and loaded it…

nav1n👨🏻‍💻⚠️, 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

The deep-link router treated a URL parameter as a trusted navigation target with only a scheme check, and the app then bound session cookies to that externally-influenced host without HttpOnly or Secure flags.

Impact

An attacker could steal a victim's live session cookie and replay it to take over the account, though the report notes the cookie was also readable by JavaScript because it lacked HttpOnly and Secure flags.

What the attacker needed

Victim taps a link; attacker-controlled HTTPS host; app installed on victim device

The fix

The app should validate the navigation target against an anchored host allowlist before setting cookies or loading URLs, never bind session cookies to externally-influenced hosts, and mark session cookies HttpOnly and Secure.

How it was found

  1. The attacker crafts a genuine brand URL with a malicious deep_link_value parameter pointing to an attacker host.
  2. The link is delivered by any channel and renders as a legitimate brand.com link.
  3. The victim taps the link, and Android App Links routes it into the app.
  4. The router extracts deep_link_value, passes the https check, and sets it as the navigation target.
  5. The value matches a recognised in-app route, landing on the screen with the cookie-writing sink.
  6. The app writes the session cookie onto the attacker host and loads it, so the attacker's server receives the cookie.

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 deep link is a web address that opens a specific screen inside an app instead of a browser. This app took a web address from the link and, without checking where it pointed, attached the user's login cookie to that address and loaded it. So a link that looked like the real brand's website could quietly hand the user's logged-in session to an attacker.

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 nav1n👨🏻‍💻⚠️

View all

3 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.