️♂️ I Forced You to Log In as Me: OAuth Gone Wrong
The OAuth callback endpoint did not validate the origin or enforce a CSRF token, so an attacker could force a victim to log in as the attacker by sending a crafted callback link. The victim's subsequent actions then occurred on the attacker's account, allowing the attacker to observe the victim's behaviour.
medium.com
Published on medium.com
That’s what a user might say if they ever realized what just happened. But the scariest part?
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 OAuth callback endpoint lacked CSRF protection and origin validation, allowing an attacker to force a login session switch.
Impact
The attacker could observe the victim's actions (profiles viewed, who they follow, videos liked) because those actions happened on the attacker's account, and the UI gave no indication of the session switch.
What the attacker needed
Victim is logged in on the app; victim clicks a crafted link; attacker has a valid OAuth account
The fix
The OAuth callback should enforce CSRF protection and origin validation, require explicit user confirmation for session switches, and display the logged-in identity prominently.
How it was found
- Register an account on the app using Google OAuth.
- Capture the login flow with Burp and save the final callback request after successful login.
- Send the callback link to a victim, for example hidden in an image tag or iframe.
- The victim, already logged in, visits the link and is logged in as the attacker.
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.
OAuth is a way to log in using another service, like Google. The app's callback step, which finishes the login, did not check that the request really came from the app, so an attacker could make a victim's browser complete a login to the attacker's account. The victim then uses the attacker's account without knowing, and the attacker can see what they do.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.