The Curious Case of the Open Redirect ($500 Bounty)
The login flow accepted a user-controlled redirect_to parameter and used it to send users to an external site after clicking a magic login link. An attacker could craft a legitimate-looking login email that redirects the victim to a phishing page, and the parameter also allowed javascript: URLs leading to reflected XSS.
Published on medium.com
Open redirects are often dismissed as low-hanging fruit in web security โ a nuisance more than a threat. After all, an open redirect simply sends a user from a legitimate site to another URL.
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 application failed to validate or restrict the redirect_to parameter to trusted domains and allowed javascript: schemes.
Impact
An attacker could use the legitimate login email to redirect victims to a phishing site and steal credentials, and could also execute JavaScript in the victim's browser via javascript: URLs, though the magic link is single-use.
What the attacker needed
Victim has a registered email; attacker can intercept requests; victim clicks the login link
The fix
The redirect_to parameter should be validated to allow only trusted internal URLs and reject external or javascript: schemes.
How it was found
- Go to the sign-in page and enter a registered email address.
- Intercept the outgoing login request with a proxy.
- Change the redirect_to parameter to an external URL.
- Forward the request; the server sends a login email.
- Open the email and click the login link.
- The browser first visits the legitimate site then redirects to the external URL.
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.
An open redirect happens when a website takes a link from the user and sends them there without checking it. Here, the login email contained a link that could be changed to point to an attacker's site, so a victim clicking a real company email could end up on a fake login page. The same parameter also allowed running JavaScript, which is a script injection bug.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.