jan-karel.com
Home / Security Measures / Web Security / Authentication Hardening

Authentication Hardening

Authentication Hardening

Authentication Hardening

Login With Backbone

Secure web development is not about extra friction, but about better defaults in design, code, and release flow.

In Authentication Hardening, what matters most is robust identity: strong authentication, reliable session management, and minimal privilege.

This makes security less of a separate afterthought and more of a standard quality of your product.

Immediate measures (15 minutes)

Why this matters

The core of Authentication Hardening is risk reduction in practice. Technical context supports the choice of measures, but implementation and assurance are central.

Defense: the complete authentication checklist

Password storage

Method Secure? Reason
Plain text No One data breach = everything leaked
MD5 No Too fast, rainbow tables exist
SHA-256 No Too fast, no salt
SHA-256 + salt Moderate Better, but still too fast
bcrypt (cost 10+) Yes Intentionally slow, built-in salt
Argon2id Yes Winner of the Password Hashing Competition; memory-hard
scrypt Yes Memory-hard, CPU-hard

The right choice in 2026 is Argon2id or bcrypt. Anything else is a finding.

Password policy

The NIST guidance (SP 800-63B) is illuminating:

  • Minimum 8 characters (preferably 12+)
  • No mandatory complexity rules (uppercase, digits, symbols)
  • No mandatory periodic password changes
  • Check against breached password databases (HaveIBeenPwned)
  • Block the most common passwords

Yes, you read that right. NIST recommends against enforcing complexity rules and periodic changes. The reason: these rules lead to predictable patterns (season + year + exclamation mark) that are weaker than a self-chosen, long password.

Rate limiting and lockout

# Example: progressive delay
DELAY_MAP = {
    3: 5,      # After 3 attempts: 5 seconds wait
    5: 30,     # After 5 attempts: 30 seconds
    10: 300,   # After 10 attempts: 5 minutes
    20: 3600,  # After 20 attempts: 1 hour
}

Implement rate limiting at multiple levels: - Per account - Per IP address - Per session - Global (as emergency brake)

Multi-factor authentication

MFA is the only defense that holds when the password has been compromised. Priority:

  1. Hardware keys (YubiKey, FIDO2): best option, phishing-resistant
  2. Authenticator apps (TOTP): good, but phishable
  3. SMS/email codes: better than nothing, but vulnerable to SIM-swap/account takeover

Let us note here that we have collectively known for more than thirty years how passwords should be securely stored. Bcrypt has existed since 1999. That's more than a quarter century. In that time, we have invented the iPhone, self-driving cars, and placed a robot on Mars. But hashing passwords with bcrypt -- that is apparently a bridge too far for some developers.

And then the password policy. We force people to change their password every ninety days, which results in "Summer2026!", and then we're surprised that someone guesses it. That's like forcing someone to put a new lock on their front door every three months, but only selling locks with three possible combinations.

The alternative -- a long, unique password that you never have to change, stored in a password manager -- is too simple. Too elegant. Where's the complexity? Where's the suffering? Because if security isn't painful, it doesn't feel like it works. And that, ladies and gentlemen, is why we still encounter "Welcome01!" as a password in Fortune 500 companies.

Summary

Authentication is the foundation of every security system. Brute force is the most direct attack on it -- inelegant but effective, especially when users choose predictable passwords. Password spraying exploits the fact that in every large organization someone has chosen the obvious password. And wordlists, custom-made with website scraping and mutation rules, are the difference between hours of futile running and a hit within minutes.

Session management -- session tokens, cookies, JWTs -- is the mechanism by which we remember authentication over stateless HTTP. Weak tokens, missing cookie flags, and vulnerable JWT implementations undermine every strong password policy.

The defense is not revolutionary: bcrypt or Argon2 for password storage, MFA for a second factor, rate limiting against brute force, and security headers as the first line of defense. These are things we have known for years. The question is not whether we know how to secure authentication. The question is why we still don't do it.

In the next chapter, we bring everything together: documenting findings, scoring CVSS 4.0, and generating reports that ensure all these vulnerabilities are actually fixed.

Op de hoogte blijven?

Ontvang maandelijks cybersecurity-inzichten in je inbox.

← Web Security ← Home