Use this when securing how users log in to web applications.
Authentication · Web Security
Web authentication verifies users with passwords plus MFA, passkeys or SSO, with rate limiting, secure password storage, generic error messages and protection against credential stuffing.
1. Web authentication: MFA, rate limiting, secure password storage, safe reset flows, no user enumeration.
2. Use proven frameworks/IdPs.
3. Generic error messages.
4. Log failures.
5. Protect against credential stuffing.
login → credential/MFA check → session
Context & applicabilityCommon mistakes · platform/version boundaries
- Different error messages for "unknown user" and "wrong password" (user enumeration).
- No rate limiting or lockout on login, reset and MFA endpoints.
- Session ID not regenerated after login (session fixation).
- Password reset tokens that are long-lived, reusable or guessable.
- Storing passwords with fast hashes (SHA-256) instead of Argon2/bcrypt.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Combine passwords with MFA or use passkeys.
- Rate limit and detect credential stuffing.
- Use generic error messages.
- Login flow test (lockout, MFA) — controls
- Password reset flow review — token security
- Authentication logs — failures
ReferenceWhy it matters1 section · depth on demand
Checklist
- Store passwords with Argon2id, scrypt or bcrypt, never plain or with fast hashes.
- Offer MFA, preferably phishing-resistant (passkeys/WebAuthn).
- Same error message for wrong user and wrong password.
- Rate limiting and lockout or CAPTCHA after repeated failures.
- New session ID after login; log out invalidates the session server-side.
- Check new passwords against breached-password lists.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Authentication in web applications verifies users before granting access to protected functions. Implementing it securely is difficult, so delegating to a mature identity provider via OIDC or SAML is usually the best approach.
If an application handles authentication itself:
| Requirement | Practice |
|---|---|
| Password storage | Argon2id/bcrypt |
| Brute-force protection | Rate limiting, lockout or progressive delays |
| MFA | Support TOTP and WebAuthn/passkeys |
| Account recovery | Secure, time-limited tokens; no security questions |
| Session handling | New session ID at login; secure cookies; timeouts |
| Error messages | Do not reveal whether the username exists |
Passkeys (WebAuthn) provide phishing-resistant, passwordless login and are supported by all major browsers and platforms.
Password rules (NIST SP 800-63B)
- Minimum 8 characters (15 recommended when password is the only factor), allow at least 64.
- No forced composition rules or periodic changes without evidence of compromise.
- Check against breached and common password lists.
- Allow paste and password managers.
- Rate-limit failed attempts.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Web Security → Authentication. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%