Web SecurityWeb Security · Lesson 06
Broken Authentication & Sessions
Credential attacks, session handling, MFA and password storage.
Video tutorialTrack course · freeCodeCamp
Speed
Transcript & captions
8/8
- Credential stuffing - reusing breached username/password pairs.
- Brute force and password spraying against weak lockout policies.
- Session fixation - forcing a known session id onto a victim.
- Token leakage - session ids in URLs, logs or referrer headers.
- Weak reset flows - guessable tokens, no expiry, user-supplied host.
| Control | Requirement |
|---|---|
| Password storage | bcrypt / argon2 with per-user salt, never MD5 or SHA1 |
| Session cookie | HttpOnly, Secure, SameSite=Lax or Strict |
| Rotation | New session id on login and on privilege change |
| MFA | TOTP or passkeys on all privileged accounts |
| Rate limiting | Per-account and per-IP with backoff |
Login responses must not reveal whether the email exists - use one generic failure message for both cases.
Knowledge check
0/2 answeredWhich hash is acceptable for passwords?
Why rotate the session id at login?