When “One-Time” Isn’t Enough: The Case of the Reusable Magic Link
The magic link used for passwordless login could be reused multiple times within its five-minute validity window, creating multiple authenticated sessions. An attacker with access to the link (e.g., via email forwarding, browser history, or logs) could gain persistent account access.
The shift toward passwordless authentication is one of the most positive trends in modern security. Magic links, in particular, offer a seamless user experience by eliminating the friction of remembering and typing passwords.
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 backend did not mark the token as consumed after the first successful authentication, so it remained valid until its time-based expiry.
Impact
An attacker who obtains the magic link through email forwarding, browser history, logs, or a shared device could reuse it to create multiple authenticated sessions within the five-minute window.
What the attacker needed
Access to the magic link; link used within 5 minutes
The fix
The token should be atomically checked and marked as consumed in a single transaction upon first use, and any subsequent request with the same token should be rejected.
How it was found
- Request a magic login link from the application.
- Authenticate successfully using the link in Browser 1.
- Copy the exact URL from Browser 1’s address bar.
- Open that copied URL in Browser 2 to create a new authenticated session.
- Reuse the same URL in Browser 3 to get yet another session.
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 special URL sent by email that logs you in without a password. Normally it should work only once, like a ticket that is torn after use. Here, the same link kept working for five minutes, so anyone who saw it later could also log in.
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.