From Open Redirect to Account Takeover: A Real-World case
The login flow accepted a callback parameter and, after authentication, redirected the user to that arbitrary URL while appending their bearer token as a GET parameter. An attacker could send a crafted login URL to a victim and receive the victim's authentication token, allowing account takeover.
As a penetration tester, you often come across open redirects, and usually, there is not much you can do with them. Most of the time, the impact is limited to untrusted redirects with potential phishing attacks.
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 client-side login code took the callback URL from the request without validating it and appended the authentication token to that URL before redirecting.
Impact
An attacker could steal a victim's bearer token and use it to make authenticated requests as the victim, resulting in account takeover.
What the attacker needed
Victim clicks a crafted login URL; victim is logged in or logs in
The fix
The application should strictly validate redirect destinations against an allowlist and never expose authentication tokens in URLs, sending them only in secure HTTP headers.
How it was found
- Visit a protected page and get redirected to the authentication subdomain.
- Notice the login form uses a GET callback parameter for redirect-back.
- Set the callback parameter to an attacker-controlled domain.
- Complete login or, if already authenticated, load the crafted login URL.
- Observe the application redirect to the attacker domain with the bearer token attached as a GET parameter.
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 log in, the site sometimes sends you back to the page you came from using a link parameter. Here the site trusted that link completely and also put a secret login token in the link. Anyone who controls that link can receive the token and use it to act as the victim.
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.