How I Turned a Simple OAuth Bug Into a One-Click Account Takeover
The OAuth callback endpoint did not validate the state parameter, allowing an attacker to link their own Google account to a victim's account via a crafted callback URL. A confirmation step that accepted cross-site GET requests was then chained to make the exploit require only one click.
medium.com
Published on medium.com
Friend link:https://sr0x01.medium.com/how-i-turned-a-simple-oauth-bug-into-a-one-click-account-takeover-d8ac8f4c149f?sk=f508f37fdb15dc2616a4fc836bdb2ad9
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 handler did not validate the state parameter, and the account-linking confirmation endpoint accepted cross-site GET requests without CSRF protection.
Impact
An attacker could link their own Google account to a victim's account, leading to a one-click account takeover.
What the attacker needed
Victim clicks a link; attacker has a Google account
The fix
The OAuth callback should validate the state parameter, and the confirmation endpoint should require a CSRF token and reject cross-site requests.
How it was found
- Craft a malicious OAuth callback URL for the Google account linking feature.
- Send the URL to the victim; the victim visits it.
- The callback fires and links the attacker's Google account to the victim's account.
- A confirmation prompt appears because the emails do not match.
- The attacker's script silently submits the confirmation request via a cross-site GET.
- The victim's account is linked to the attacker's Google account with one click.
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 for websites to let you log in using another service, like Google. The 'state' parameter is a secret code that the website should check to make sure the login request really came from you. Because the site skipped that check, an attacker could trick you into linking their Google account to your account, giving them access.
What is OAuth / SSO?
Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.