Open philipbroistedt opened 1 year ago
An elaboration of the reset password mechanism. An actual question would be the Note in the Flow 1 section, where the stateless nature of the timed tokens generated in themselves cannot prevent an anonymous actor on the Internet who knows a user's ~password~ email from potentially spamming their email inbox. Other mechanisms would be required to prevent that.
Overall we need three views and two user flows outlined in detail below.
FlaskTokenService
).Note:
FlaskTokenService
):
A form consisting of:
Note:
A form consisting of:
A page of text consisting of:
I think that the concern you raised in the OP regarding spam email is pretty serious. Do you have any ideas on how to mitigate this vulnaribility?
State must be introduced to deal with this issue fundamentally. One possibility is to have a table with the columns: email, hashed unique url token, timestamp. When the reset password flow for a valid email is triggered an entry can be made, then the number of entries for the given email can be counted for the past x minutes, if the count is above a certain threshold n, then the email sending service would not be triggered. On the reset password flow where a user opens a link from the email, then the decision of whether a valid or invalid view is returned can be based on the entry timestamp as well, i.e. how old the newest entry is for the given email (or it can be still based on a timed token).
Such a table would have to be cleaned periodically by some job, deleting all entries older then a certain amount of time.
The user should be able to request an email that contains a password reset link. Clicking that link should direct the user to a webpage where they can enter a new password. The link to reset the password should be valid for 15 minutes.