Web SecurityWeb Security · Lesson 06

Broken Authentication & Sessions

Credential attacks, session handling, MFA and password storage.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 2 checkpoints Watch on YouTube More on this topic
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.
ControlRequirement
Password storagebcrypt / argon2 with per-user salt, never MD5 or SHA1
Session cookieHttpOnly, Secure, SameSite=Lax or Strict
RotationNew session id on login and on privilege change
MFATOTP or passkeys on all privileged accounts
Rate limitingPer-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 answered

Which hash is acceptable for passwords?

Why rotate the session id at login?