Skip to content
Account takeover Write-up Intermediate

Pre-Account Takeover via OAuth Misconfiguration

The site allowed registration with any email address without verifying ownership, and when the real owner later signed up via Google OAuth with the same email, both the attacker's password login and the victim's OAuth login remained valid on the same account. An attacker could therefore pre-register an account using a victim's email and retain silent shared access after the victim joined.

medium.com

Published on medium.com

Free Article Link: Click for free!

Ehtesham Ul Haq, 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 registration flow never verified email ownership and the OAuth login linked to an existing account with the same email without requiring proof of ownership or invalidating the existing password session.

Impact

An attacker could silently retain access to a victim's account before the victim ever registered, potentially viewing or altering sensitive information, with no session invalidation or alert to the user.

What the attacker needed

Attacker knows victim's email address; victim has not yet registered on the site; victim later signs up via Google OAuth

The fix

New accounts should require email verification, OAuth sign-in to an existing email should require proof of ownership, and existing sessions should be cleared with alerts on authentication changes.

How it was found

  1. The attacker registers on the standard sign-up page using the victim's email address and a password of their choice.
  2. Because no email verification is required, the attacker is logged in immediately.
  3. The real user later signs up with Google OAuth using the same email address.
  4. The site lets the user in without warning and may prompt a password reset.
  5. The attacker's original credentials still work, so both parties share access to the account.

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 sign up with an email address, a safe site sends a message to that address to prove you own it. Here the site skipped that check, so anyone could claim any email address with a password. Later, when the real owner signed in with Google using the same email, the site linked them to the attacker's account instead of noticing the clash, leaving the attacker with access.

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.