Oauth Misconfiguration Leads To Pre Account Takeover
The site allowed an attacker to pre-register an account using a victim's email address via email signup, and later the victim could log in through Google OAuth without the site checking that an account already existed for that email. This let the attacker log in with the password they set, bypassing verification and taking over the account.
Today I am going to share one of my interesting findings on the private program of Bugcrowd. Since this is on a private program,so I will be using target.com as the website name.
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 login flow did not verify whether an account with the same email already existed, allowing an attacker to pre-register the victim's email and later have the victim's OAuth login attach to that attacker-controlled account.
Impact
An attacker who knows a victim's email address could take over the victim's account once the victim signs up or logs in via OAuth, gaining complete account access.
What the attacker needed
Attacker knows victim's email address; victim uses Google OAuth to sign up or log in
The fix
The site should either prevent OAuth login when an account with the same email already exists, or warn the user that an account already exists and ask them to verify or change the password.
How it was found
- Sign up on the target site using the victim's email address via the email registration form.
- Wait for the victim to sign up or log in using Google OAuth with the same email.
- The victim is logged in, and the attacker can then log in using the password set during the initial signup.
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 Google, the site should check if an account with your email already exists. Here it did not, so someone could create an account with your email first, set a password, and then when you later used Google to log in, the site linked your Google login to that attacker-made account. The attacker could then log in with the password they set and access your 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.