Password Reset Glitch Leads to Instant Account Takeover
The password reset page stored the user's email in local storage and used that value when resending the reset email, instead of the email tied to the reset token. An attacker could change the local storage email to their own and resend the reset link, which would be sent to the attacker's address but still allow resetting the victim's password.
Published on bevijaygupta.medium.com
I reported this bug in March 2023, but due to the team’s delay, I completely forgot about it. To my surprise, I discovered a week ago that they had actually responded about three months ago, in December 2023!
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 trusted a client-side value (the email in local storage) to determine the recipient of the password reset email, instead of using the email associated with the reset token on the server.
Impact
An attacker could take over any user's account by receiving the password reset link for that user, as demonstrated by resetting the victim's password.
What the attacker needed
Victim's email address known; attacker can access the reset password page; attacker can modify local storage in their browser
The fix
The application should determine the recipient email from the server-side reset token, not from a client-controlled local storage value.
How it was found
- Go to the reset password page and enter the victim's email address.
- After the first reset link is sent to the victim, open the browser console and change the user_email value in local storage to the attacker's email.
- Reload the page and click the resend email button.
- Open the attacker's email inbox and use the received link to reset the victim's password.
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 sends a reset link to your email. This site saved your email address in the browser's local storage (a small storage area websites use) and later used that saved value to decide where to send the reset link. An attacker could change that saved email to their own, so the reset link for the victim's account went to the attacker, letting them take over the 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.