Skip to content
Account takeover Write-up Intermediate

How a Small Validation Flaw Led to a 0-Click Account Takeover

A password reset request that failed reCAPTCHA validation still returned a reusable state token. By swapping that token into the Google OAuth callback and changing the email hint, the researcher could register into and log in as another user's account with no victim interaction.

medium.com

Published on medium.com

Bug bounty hunting, for me, is mostly about understanding how applications handle authentication. Login, registration, password reset.

ohmyleg, 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

Root cause

Likely the server issued a valid state token despite failed validation and then trusted that client-supplied token, rather than the authenticated session, to decide which user the flow belonged to.

Impact

An attacker could gain a valid session as another user without any interaction from the victim, without their password and without access to their email.

What the attacker needed

A Google account for the attacker; victim's email address known; no victim interaction needed

The fix

The reset flow should not issue a reusable state token when validation fails, and the OAuth flow should bind the token to the authenticated session and server-side identity rather than client-supplied parameters.

How it was found

  1. Send a password reset request with a corrupted reCAPTCHA token and note the state token still returned in the error response.
  2. Start a Google OAuth login with your own account and intercept the callback request.
  3. Replace the callback state token with the one from the failed reset and adjust the registration parameters and email hint.
  4. After the error, choose to start over, which lands on a registration page pre-filled with the victim's email.
  5. Set a password and submit the registration form, then observe you are logged in as the victim.

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 through a service like Google, the site passes a short-lived code called a state token between steps to remember who you are. Here the site handed out that token even when a check failed, and then trusted it to decide which account you were, so someone could point it at another person's email and end up inside their account.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.