Breaking In Through the Backdoor: Password Reset Gone Wrong
The password reset and email verification features shared the same endpoint and six-digit code, so a password reset code could be used at the verification endpoint to set a new password. An attacker who knew a user's email address could take over any account without victim interaction.
medium.com
Published on medium.com
Free Article Link: Click for free!
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 email verification and password reset flows shared the same route and code validation logic, so a reset code was accepted by the verification endpoint that also allowed password changes.
Impact
Any attacker who knows a user's email address could take over their account, affecting all users and giving full control including billing and private data, with no additional verification required.
What the attacker needed
Knowledge of victim's email address; no victim interaction needed
The fix
The password reset and verification processes should use completely separate routes with unique one-time tokens tied to the specific action, and password updates should only happen through secure authenticated routes with token type, expiration and session checks.
How it was found
- Register a new account and verify it, or use an existing target user.
- Initiate a password reset for the email.
- Find the email containing the six-digit verification code.
- Instead of using the password reset link, go to the verify URL with the email and code.
- Replace the email and code placeholders with the values from the email.
- Land on a page where you can set a new password, taking over 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 forget your password, a website emails you a short code to prove it's you. Here, that same code also worked on a different page meant for confirming your email address, and that page let you set a new password. So anyone who knew your email address could request a reset, read the code from their own inbox only if they controlled the email, but the report says the code from a reset email for the victim's address could be used, meaning the attacker did not need the victim's inbox.
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.