Story of a Pre-Account Takeover
The application allowed a social login account to be permanently linked to an email address without any way to unlink it. An attacker could sign up with their own Google account, change the email to the victim's, and later log in via Google to access the victim's account after the victim reset the password.
Published on dhakal0kushal.medium.com
Hello everyone, hope you are having a great day. Today I am going to talk to you about an interesting bug that I found on a private program on HackerOne.
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 during social signup and allowed the email to be changed before completion, while also lacking a way to unlink social accounts.
Impact
An attacker could take over a victim's account by linking their social account to the victim's email and later logging in via Google, even after the victim resets the password.
What the attacker needed
Attacker has a Google account; victim has not yet signed up; victim resets password
The fix
The application should verify email ownership during social signup and provide a way to unlink social accounts.
How it was found
- Sign up with the attacker's Google account.
- Set a username, email, and password for the account.
- Change the email to the victim's email and complete signup.
- The victim tries to create an account but sees an email already exists message.
- The victim resets the password successfully.
- The attacker logs in with Google to access the victim's 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 Google, the app remembers that your Google account belongs to that email. The app had no way to remove that link. So an attacker could link their Google account to someone else's email, and later use it to log in as that person.
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.