Skip to content
Account takeover Write-up Intermediate

How I Turned a Magic Link Feature Into Account Takeover

The magic-link login flow validated the redirect destination by checking only whether the hostname ended with the target domain, so an attacker-controlled domain such as attackerredacted.com was accepted. An attacker could send a victim a legitimate-looking login email whose link redirected to the attacker's domain, where the login link containing the account credentials could be stolen.

mrx_w_ Follow

Published on medium.com

Hi, I’m mrxw (Adem Ziane Berroudja), a bug bounty hunter on Bugcrowd.

mrx_w_, 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

Impact

An attacker could take over a victim's account by stealing the magic login link, and the report was triaged as P2 and paid.

What the attacker needed

Attacker-controlled domain ending with target name; victim clicks the magic login link

How it was found

  1. Intercept the request that generates the magic login link.
  2. Set the redirect-url parameter to an attacker-controlled domain that ends with the target domain name.
  3. Send the generated login email to the victim.
  4. The victim clicks the login button and is redirected to the attacker's domain.
  5. Capture the login link containing the values needed to sign in to the victim's account.

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 magic link is a login link sent by email that signs you in without a password. The site checked the redirect address by looking only at the end of the domain name, so a domain the attacker owned that ended with the same letters was treated as safe. The victim clicked a real-looking email link and was sent to the attacker's site, which could capture the login link and take over the account.

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 mrx_w_

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.