Skip to content
Account takeover Write-up Intermediate

OAuth Misconfiguration: Preemptive Account Registration Exploitation

The OAuth flow did not verify whether an account already existed for an email before allowing registration. An attacker could register an account with a victim's email, and when the victim later completed OAuth registration, the attacker's account was confirmed, letting the attacker log in with their own credentials.

mmnahian Follow

Published on mmnahian.medium.com

The OAuth misconfiguration allows an attacker to preemptively register an account using a victim’s email. When the victim later tries to register with OAuth, the system confirms the attacker’s account instead.

mmnahian, on mmnahian.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 OAuth registration flow failed to check for an existing account before creating or confirming one, allowing an attacker to pre-register an email and have it confirmed by the victim's later OAuth login.

Impact

An attacker could gain access to an account intended for the victim, compromising account integrity.

What the attacker needed

Attacker knows victim's email; victim uses OAuth to register

The fix

The OAuth registration flow should verify email ownership and check for existing accounts before confirming or linking an account.

How it was found

  1. The attacker registers an account using the victim's email address before the victim uses OAuth.
  2. The victim later attempts to register using OAuth with the same email.
  3. The system sees an existing account for that email and confirms the attacker's account.
  4. The attacker logs in with the email and password they set during registration.

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 in with a service like Google, the website should check if your email is already linked to an account. Here, it did not check properly. An attacker could create an account using someone else's email first, and when the real owner later signed in with OAuth, the system treated the attacker's account as confirmed, giving the attacker 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.

More by mmnahian

View all

3 more disclosed reports, best first.

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.