How I Found 5 OAuth Misconfigurations Leading to Pre-Account Take
The application allowed signing up with an email and password without verifying the email, then later logging in via Google OAuth with the same email automatically linked to the existing account. An attacker could pre-register a victim's email and later take over the account before the victim signs up or verifies it.
Published on medium.com
My name is Khaled Ahmed (KhaledAhmed107), a Cybersecurity researcher and active bug bounty hunter on Bugcrowd. I recently started my journey in bug bounty hunting, I’ve managed to submit several reports across different programs — including P1 findings (one on NASA and another on the U.S.
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 application did not verify email ownership before allowing OAuth login to link to an existing account with the same email address.
Impact
An attacker could take over user accounts before the real owner signs up or verifies their email, leading to unauthorised access to personal data and potential fraud.
What the attacker needed
Attacker can sign up with victim's email; victim has not yet signed up or verified
The fix
The application should verify email ownership before linking an OAuth login to an existing account, for example by requiring email verification or confirmation.
How it was found
- Sign up with an email and password; the account is created without email verification.
- Log out.
- Click 'Login with Google' and use the same email address.
- The OAuth login is automatically linked to the existing account, allowing login without email verification.
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 create an account, the site should check that the email really belongs to you, usually by sending a verification link. Here, it did not check, and it also let a Google login with the same email attach to that unverified account. So someone else could claim your email first and later log in as you.
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.