

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Authentication
incomplete
2: Stateless vs. Stateful Authentication
incomplete
3: What Are Sessions?
incomplete
4: What Are Cookies?
incomplete
5: Cookie Security
incomplete
6: Session Lifetime
incomplete
7: Password Resets
incomplete
8: Broken Password Reset Flow
incomplete
9: OAuth 2.0
incomplete
10: SAML and OIDC
incomplete
11: API Keys
incomplete
12: Reauthentication
incomplete
13: Authentication Misconceptions
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A password reset flow can do everything right – use strong, short-lived, single-use tokens – and still leak account information. If the reset request tells a user:
No account found for that email address.
... then attackers can use it as an account lookup tool. They can submit a list of email addresses and learn which ones actually have accounts. It's especially risky in authentication flows because it gives attackers a better target list for phishing, credential stuffing, and social engineering.
Password reset request pages should return the same public status and message whether or not the email exists:
If an account exists for that email, we'll send a reset link shortly.
Frustratingly, showing a neutral response message still isn't enough in some cases; response timing can also be a problem. If the password reset endpoint returns immediately when no account is found, and takes a bit longer to return when a reset token is actually generated, then attackers may notice that.
The strongest production systems defend against timing attacks by processing password reset requests asynchronously. An attacker should receive no signal of whether an account was found.
Bearly Secure's reset request route reveals which email addresses have accounts: unknown emails receive an error, while known emails receive a reset link in the response. Update the flow so both receive the same status and neutral confirmation page without a reset link. For local testing purposes, Bear Mail prints successful reset links to the server terminal.
If an account exists for that email, Bear Mail will send a reset link shortly.
With Bearly Secure still running, run and submit the CLI tests from the project root.