Login and signup messages that reveal which accounts exist (account enumeration)

Last updated November 17, 2026
Steps
- Test it yourself: try logging in with a real account and a wrong password, then with an email that doesn't exist. Compare the message, the HTTP status code and the response body in your browser's network tab.
- Return one generic login failure for both cases, for example "Invalid email or password", with the same status code and response shape.
- Keep timing similar: when the user isn't found, still run a password hash comparison (against a dummy hash) instead of returning early.
- On signup, don't say the email is taken. Show "Check your email to continue" and send the existing user a notice or sign-in link instead of a new-account email.
- Apply the same rule to password reset and "resend verification" endpoints (see our password reset page).
- Add rate limiting and bot protection on login, signup and reset, since generic messages alone don't stop high-volume guessing.
- Check your auth provider's settings. Some hosted auth tools have their own option to protect against enumeration; turn it on if available.
Why it matters
OWASP's Authentication Cheat Sheet says login, password recovery and account creation should respond with generic messages, whether or not the user ID or password is correct, and notes that different HTTP status codes or a faster "quick exit" for unknown users can still reveal whether an account exists. It recommends protections against automated attacks, such as rate limiting and CAPTCHA, alongside generic responses. MITRE tracks the timing and response differences as CWE-203 (Observable Discrepancy) and CWE-204 (Observable Response Discrepancy). A confirmed list of your users' emails makes targeted phishing and credential stuffing easier.
Sources
OWASP Cheat Sheet Series: Authentication Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
MITRE CWE-204: Observable Response Discrepancy — https://cwe.mitre.org/data/definitions/204.html
MITRE CWE-203: Observable Discrepancy — https://cwe.mitre.org/data/definitions/203.html
Related patterns
- Password reset flows that leak accounts or trust the Host header
- No rate limiting on login, signup or AI endpoints
- Error messages that leak stack traces, queries or keys
- Passwords stored in plain text or with fast hashes
- NoSQL operator injection: login and search filters built from raw JSON
- GraphQL APIs with introspection on and no depth or cost limits
- “Sign in with Google” that logs people into any account with the same email (unsafe account linking)
Found a problem you'd rather not fix yourself?
Tell us what's wrong. A StorenTech engineer reviews your app and replies with a fixed quote, so you know the cost before any work starts.
Get it fixed by StorenTechVibe Security Weekly
One email a week with new failure patterns and how to fix them.
By joining you agree we may email you this newsletter. See our privacy policy. Free. Unsubscribe anytime. We'll never sell your email.