TL;DR
Secure password reset requires cryptographically random tokens, short expiration times (1 hour max), single-use tokens, rate limiting, and no information leakage about account existence. Always notify users when their password is reset and invalidate existing sessions. 6 critical items must be fixed before launch, 7 important items within the first week, and 3 recommended items when you can.
Quick Checklist (5 Critical Items)
::checklist-item{label="Do not reveal if email exists" description=""If an account exists, we sent instructions" for all requests"} ::
Token Generation 4
Request Handling 4
::checklist-item{label="Do not reveal if email exists" description="Always show the same message: "If an account exists, we sent instructions." Do not confirm or deny email existence. How to prevent account enumeration"} ::
Reset Process 4
User Communication 4
Common Password Reset Vulnerabilities
Password reset is one of the most attacked features in web applications. Common vulnerabilities include: predictable tokens, no rate limiting (enabling email bombing), account enumeration through different responses, tokens that never expire, and reusable tokens.
According to OWASP, broken authentication remains in the top 10 web application security risks. A secure password reset flow is essential for overall authentication security.
How long should password reset tokens be valid?
Password reset tokens should expire within 1 hour, with 15 to 30 minutes being more secure. Tokens should also be single-use, meaning they become invalid after a successful password reset.
Should I tell users if an email does not exist?
No. Always show the same message regardless of whether the email exists. Saying "email not found" lets attackers enumerate valid accounts. Say something like "If an account with this email exists, we have sent reset instructions."
Should I require the current password to reset?
For a "forgot password" flow, no. Users forgot their password, so they cannot provide it. For a "change password" feature (when logged in), yes, require the current password to prevent session hijacking attacks from changing the password.
Test Your Password Reset
Security scanning can help identify authentication vulnerabilities.
Start Free Scan