Lesson 6 of 19 · 20m
Password Storage and Credential Attacks
Leaked fast-hash dumps are password lists on a schedule — Argon2id, salts, peppers, credential stuffing, and breached-password screening.
Your database gets dumped — pick your incident, it doesn't matter which, because the important part is the second sentence: the file contains email,password_hash rows for every user. What happens next is arithmetic, and the arithmetic is entirely determined by which hash function is in that column.
If it's SHA-256 — even salted SHA-256 — an off-the-shelf GPU running hashcat computes on the order of twenty billion hashes per second — an RTX 4090 pushes roughly 22. A leaked SHA-256 database is not a leak of hashes; it is a leak of passwords, delivered on a schedule set by the attacker's hardware budget. LinkedIn learned this in 2012: over a hundred million unsalted SHA-1 hashes dumped, and the cracking community turned it into the foundational wordlist still used today. RockYou's 2009 plaintext breach (32 million passwords, no hashing at all) is why every modern wordlist exists. Adobe 2013 managed a different failure: 153 million accounts encrypted with 3DES — reversible, with password hints stored next to them.
The wrong mental model: "we hash passwords, so we're covered." Hashing is a spectrum. Fast hashes — MD5, SHA-1, SHA-256, SHA-512 — were designed to verify data integrity at wire speed, and wire speed is exactly what you don't want when the input is a human-memorable secret. You want a function that is deliberately expensive and, better, deliberately memory-hungry, because GPUs parallelize compute but not RAM.
The functions that hold
Argon2id is the current answer — RFC 9106 (2021), winner of the Password Hashing Competition. Memory-hard, tunable on three axes: memory cost, iteration count, parallelism. OWASP's cheat-sheet minimum is m=19 MiB, t=2, p=1. Real deployments tune upward until verification takes ~300 ms on your own hardware — the attacker's cost scales identically.
# argon2-cffi
from argon2 import PasswordHasher
ph = PasswordHasher(time_cost=2, memory_cost=19456, parallelism=1)
stored = ph.hash(password) # self-describing: params + salt + hash
ph.verify(stored, candidate) # raises on mismatchbcrypt is still acceptable — cost factor ≥10 — and its 72-byte input limit is a known quirk (SHA-256 the password first if you need longer inputs, or live with truncation). scrypt is memory-hard and fine. PBKDF2-HMAC-SHA256 is the legacy-acceptable floor at 600,000+ iterations. What is not acceptable: any single-pass fast hash, any unsalted anything, and any construction you invented.
The salt is per-user, 128+ bits, from a CSPRNG, stored beside the hash — it is not a secret, it is a uniqueness guarantee that forces the attacker to crack each password separately instead of amortizing the work across the whole dump. A pepper is different: a server-side secret mixed into the hash and stored outside the database (KMS, env var, HSM), so a DB-only dump can't even start cracking. Optional, operationally annoying, genuinely useful — if you use one, you must handle rotation and fail-closed startup.
What the attackers actually do
Almost nobody brute-forces anymore. The economics favor two cheaper attacks:
Credential stuffing — take the billion-plus email:password pairs already public and replay them at your login. Success rates run around 0.1–1%, which sounds tiny until you multiply by botnet scale. Defenses: rate-limit by IP and by account (per-account limits alone get defeated by spraying one password across many accounts — that's password spraying, the inverse), check candidate passwords against breached lists via HaveIBeenPwned's k-anonymity API at signup and login, and add MFA for accounts worth protecting. NIST 800-63B says the quiet part out loud: length beats composition rules, forced periodic rotation is dead, and breached-list screening is the actual control.
Timing oracles — a login that returns "user not found" fast and "wrong password" slow (after hashing) leaks which accounts exist. Return the same response shape for both; run the hash comparison on a dummy digest for unknown users. Same trap in "is this email registered" endpoints — every invite, reset, and signup flow that answers differently for known addresses is a membership oracle.
The recovery path is the real attack surface
Attackers don't beat your Argon2id; they beat your reset flow. A reset token is a credential: 128+ bits CSPRNG, single-use, minutes-long TTL, hashed at rest, bound to the account, and it must kill existing sessions and tokens on use. If your reset email contains a token valid for 30 days, the Argon2id column is decoration.
Try this
Compute your login latency. If POST /login returns in 5 ms, your hash is too cheap or missing. Then grep the codebase for sha256(, md5(, and hashlib calls near password — you are looking for the function, the salt handling, and whether the pepper (if any) is in the same file as the database credentials.
Pitfalls
- Encrypting passwords (AES) just moves the problem to key management — a breach gets the key too. Hash, don't encrypt.
- Salts must be random per password. A global salt defeats its own purpose.
- Lockout policies create a DoS — attackers lock every account for the price of one request each. Backoff, CAPTCHA, and rate limits instead.
- Storing hashes you can't re-tune. Argon2id/bcrypt params are stored in the hash string — rehash on login when you raise the work factor.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Building a Production REST API With Node.js and Express
Build a REST API in Node.js and Express the way production systems need: input validation, JWT auth, refresh token rotation, status codes, rate limiting, idempotency keys, and centralized error handling.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.
Next.js Shipped Seven Advisories and Six of Them Are the Cache
The November 2026 Next.js security release patches seven issues, and six live in the new Cache Components layer, the feature meant to make your app faster by remembering more. Three hit self-hosted next start specifically: the ones Vercel's own platform quietly absorbs.
Forum Archaeology: Nulled vBulletin, XenForo, and the Missing Footer
I could spot a nulled forum in about four seconds, and it never stopped being funny. Here's why the copyright line gives it away, what a measured 97% of nulled add-ons actually contain, and why MyBB quietly became the smart choice for everyone who wanted the look without the paper trail.