The usual thread to reset a user's password in the mail:
- Create a random row and save it in the database table
- Email string for user
- User clicks a link containing a string
- The string is checked against the database; if it matches, user pw reset
However, saving the table and expiring old rows, etc. seems a bit unnecessary. Are there any obvious flaws in this alternative approach?
- Generate MD5 Hash of Existing User Password
- Email string for user
- User clicks a link containing a string
- The string is checked by hashing the existing pw; if it matches, user pw reset
Please note that the user password has already been saved in a hashed and salty form, and I just want to delete it again to get a unique but repeatable string.
And yes, there is one obvious “flaw”: the reset link generated in this way will not expire until the user changes his password (clicks the link). I really don’t understand why this will be a problem, although if the mailbox is hacked, the user will still be screwed. And there is no risk of reuse, because after changing the user password, the reset link will no longer match.
security reset forgot-password
jpatokal
source share