Forgot password link doesn't expire after used, only after some hours
Password reset links stayed valid after being used and after newer reset links were issued, so a single leaked token could be replayed to change the victim's password again. An attacker who gained access to the victim's email could reuse an old or already-used reset token to take over the account.
Originally disclosed on HackerOne
- Fixed in 5 hours
- Disclosed after 3 days
Summary by the program
Password reset links expired after 12 hours. Now they also expire when the password has been changed.
The report
Hi, Hope you guys are doing great. I want to report couple of issues regarding forgot password mechanism. ##1st ISSUE: One thing I noticed that when password rest link is requested and user change its password, that reset link should expire immediately but in your case , used reset link can be reused again and again. This will cause an attacker to take over victim account if he somehow gain victim email account access and found password reset token in emails. ##POC: 1- Go to https://wakatime.com/reset_password 2- Enter your email address and you will get one password reset token in your email. 3- Now change password using that link and you will be successfully log in from your new password. 4- Now log out and change password again using reset token which is sent in step2. 5- You will see your password will again changed.
##2nd ISSUE: Second issue I want to report is that when multiple token is requested , previous one should be expired immediately which in your case is not. This will cause an attacker to take over victim account if he somehow gain victim email account access and found unused password reset token in emails.
##POC: 1- Go to https://wakatime.com/reset_password 2- Enter your email address and you will get one password reset token in your email. Call this token1. 3- No repeat step 1 and 2 and you will get another rest token. Call this token2 3- Now change password using token2 and you will be successfully log in from your new password. 4- Now log out and change password again using token1 which is sent in step2. 5- You will see your password will again changed.
##POSSIBLE FIX: All used password reset link should be expired immediately. All unused password reset token should be expired immediately with the issue of new token .
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 reset tokens were not invalidated on use or when a new token was issued, so old tokens remained valid until their time-based expiry.
Impact
An attacker with access to the victim's email could reuse an old or already-used reset token to change the victim's password and take over the account.
What the attacker needed
Access to victim's email inbox; a previously issued reset token
The fix
Reset tokens should be invalidated immediately once used and whenever a new token is issued; the program states that reset links now also expire when the password has been changed.
How it was found
- Request a password reset for your own email address and receive a reset token.
- Use that link to change the password and log in with the new password.
- Log out and use the same reset token again to change the password a second time.
- Request a second reset token, then change the password using the newer token.
- Log out and use the first, older token to change the password again.
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 that lets you set a new one. Normally that link should stop working once you have used it, or once a newer link is sent. Here it kept working, so anyone who later saw that email could still use the link to change your password.
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.