Skip to content
OAuth / SSO Write-up Intermediate

How I Found a Critical 1-Click Account Takeover (ATO) in XxXxx.co

The OAuth account-linking flow on target.com did not check the state parameter when it was removed from the callback URL. An attacker could link their own Google account to a victim's active session, then log in as the victim and take over the account.

Sangith Follow

Published on medium.com

The Hunt for a Critical Flaw My recent target was target.com. I focused on one of the most common weak points in modern applications: Account Linking (the "Login with Google/Facebook" feature).

Sangith, on medium.com

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

Impact

An attacker could achieve a one-click account takeover of any logged-in user by linking the victim's account to the attacker's Google identity, giving the attacker full control of the victim's profile.

What the attacker needed

Victim is logged into target.com; victim clicks the attacker's link; attacker has a Google account

The fix

The server should always validate the state parameter and reject OAuth callbacks where it is missing or does not match the expected value.

How it was found

  1. Log into your own target.com account and start the 'Link with Google' process using your attacker Google account.
  2. Intercept the callback URL that contains the temporary login code and the state token.
  3. Delete the state parameter from the URL entirely.
  4. Send the modified link to a victim who is logged into their target.com account.
  5. The victim clicks the link, and their session is silently linked to the attacker's Google account.
  6. Log out, then log back in using the attacker's Google account to access the victim's profile.

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 state parameter is a secret code the server should check to make sure the login request really came from its own site. Here, the server skipped that check if the code was missing, so an attacker could trick a logged-in victim into linking the attacker's Google account and then take over the victim's account.

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.

More by Sangith

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

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.