Conversation
…g the password reset function
brandonkelly
left a comment
There was a problem hiding this comment.
Couple issues with this:
- I don’t think we should be repurposing
verificationCodeIssuedDatefor this. - It could introduce a new user enumeration vector, as the way it’s coded, you’d get an exception thrown immediately whenever you submit a reset-password form for a valid username/email multiple times, but not for invalid usernames/emails.
Given the second point, it might make more sense to simply set a rate limit on the users/send-password-reset-email action, regardless of which username/email is provided.
|
Hi @brandonkelly — thanks for looking into this! It seems like we're considering two different approaches here, so it would be helpful to know which direction you'd prefer before I update my pull request.
My intention was to avoid introducing a new database column just to track password resets.
I've updated the pull request so that, when the cooldown is active, it now fails silently instead of throwing a new exception. I also added an error boundary around the call to
That’s a good idea too. From what I can tell, Yii doesn’t provide built-in support for request rate limiting, so we’d likely need to implement it ourselves. If that’s the preferred route, I’d be glad to work on a separate PR for that. |
Description
Add a password reset cooldown to prevent the possibility of exploiting the password reset function
Related issues
#17337