25

I am currently working on a password reset flow. We have decided to go with a password reset link being emailed to the user's registered email and allowing them to follow that and input a new password of their choosing.

The current implementation we have in mind provides a one-time use token but not a timeout feature. Currently the research I have done on the matter seems to suggest that expiring these tokens is in some way more secure than not. However, people have not been citing why that is the case.

Can someone provide a use case where that token (while still being a one-time use) not expiring would be harmful security wise?

Additional Details: I am well aware that sending a password reset link is not the most secure way to handle this problem. Ideally we would not want to obfuscate this security to the email provider. However, we have made the decision to go with a password reset link. We are only trying to determine whether we want that to expire or not. For more information on the matter:

http://www.fishnetsecurity.com/sites/default/files/media/10WP0003_BestPractices_SecureForgotPassword%5B1%5D_0.pdf

Austin DeVinney
  • 351
  • 1
  • 3
  • 4
  • 1
    Related: http://security.stackexchange.com/questions/1918/can-anyone-provide-references-for-implementing-web-application-self-password-res – Null Nov 20 '12 at 18:03
  • 1
  • Hash the reset token when storing it in the database. 2) Add an expiration date so that a 5 year old one still in someone's mailbox isn't still valid.
  • – ewanm89 Nov 20 '12 at 19:38
  • Just wanted to follow up on the matter with my decision (in the comments): http://www.reddit.com/r/PHP/comments/13ioz1/password_reset_links_timeouts/ – Austin DeVinney Nov 20 '12 at 19:42
  • What reason do you have for not expiring the token outside of not wanting to bothering to implement it? What use case is there for a week old, month old or even years old reset link to work? It should be relatively quick and straight forward so add a short, 30 minutes to an hour time out on the link and let people know about it. – Evan Steinbrenner Nov 02 '16 at 20:33
  • I would say it depends on whether, once authenticated, a user can change their email address. If so, then you should definitely expire the tokens. But you forgot to tell us if this is the case. – symcbean Nov 29 '17 at 21:04
  • Over time you'll have more and more live password reset links - not sure how many users you have but if it's a significant number then the likelihood of one being discovered/brute forced continuously increases if they don't expire. – Arlix Nov 30 '17 at 10:06
  • Harmful scenario: For some reason the receiver does not use the link, but also keeps the message. Then after three years the mailbox gets compromised and the link is used to reset the password... – U. Windl Dec 27 '23 at 12:17