Password reset links should expire after being used, instead of at specific time
Password reset links remained valid after a user changed their email address, so an attacker who had compromised the old email could still use a previously issued reset link to take over the account. The report demonstrates that changing the email address does not invalidate old reset tokens.
Originally disclosed on HackerOne
- Fixed in 7 hours
- Disclosed after 24 days
Hi,
Hope you are good!
Steps to repro:
- Create an account having any email address like "[email protected]".
- Now Logout and ask for password reset link. Don't use the password reset link sent to your mail address.
- Login using the same password back and update your email address to "[email protected]" and verify the same. Remove "[email protected]".
- Now logout and use the password reset link which was mailed to "[email protected]" in step 2.
- Password will be changed.
Fix:
All previous password reset links should automatically expire once a user changes his email address.
So below is the attack scenario:
-
My email account is compromised. Attacker asks for password reset link for my account.
-
I got to know, I change my email address on my account. I now assume i am safe.
-
But the hacker can still use the old password reset links (which he had never used for single time) which were sent to my old email address.
-
My account is now compromised again.
Please let me know if you need any other information and thanks again for looking into this.
Please fix this.
Best Regards Piyush kumar
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not invalidate outstanding password reset tokens when the user's email address is changed.
Impact
An attacker who had access to the old email address could use an unused reset link to change the password and take over the account, even after the victim changed their email address.
What the attacker needed
Attacker has access to the old email account; victim changes email address after reset link is sent
How it was found
- Create an account with an email address.
- Log out and request a password reset link, but do not use it.
- Log back in with the same password, change the email address to a new one, verify it, and remove the old email.
- Log out and use the password reset link that was sent to the old email address.
- The password is changed successfully.
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 report has not been written yet. The Original tab links to the source.
When you forget your password, a website emails you a special link to reset it. This report shows that if you later change your email address, an old reset link sent to your previous email still works. That means someone who had access to your old email could still use that link to change your password and take over 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.