Credential stuffing: spotting reused passwords tried at scale
Credential stuffing replays username and password pairs leaked from other sites. How it looks in login logs, why per-IP limits miss it, and the defenses that work: MFA, breached-password checks, and bot signals.
Diagram
A stuffing run in login telemetry
Step 1 of 4
Volume
Failed logins spike across many accounts, each tried once or twice.
time attempts unique_users unique_ips success 02:00 4,210 3,980 1,140 0.6%
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Telemetry shape
- What fails
- Many accounts, few tries each, and a low but real success rate.
- Who is affected
- Users who reused passwords from breached sites.
- What you would notice
- Failed-login spikes with high unique-user counts.
- What you change
- Alert on failure ratio and unknown-username rate, not just raw counts.
Breached passwords
- What fails
- Users pick passwords that already appear in breach corpora.
- Who is affected
- Those users, first.
- What you would notice
- No breached-password check at sign-up or change.
- What you change
- Check new passwords against breach data with a k-anonymity API.
MFA closes most of it
- What fails
- A correct password is not enough with MFA in place.
- Who is affected
- Accounts without MFA.
- What you would notice
- Successful logins from new devices without a second factor.
- What you change
- Require MFA, phishing-resistant for admins.
A detection query
Group failed logins by time window and compare unique usernames to attempts. Stuffing has a ratio near one; a single user mistyping a password has many attempts for one name.
-- generic SQL over auth logs
SELECT date_trunc('minute', ts) AS m,
count(*) AS fails,
count(DISTINCT username) AS users,
count(DISTINCT src_ip) AS ips
FROM auth_events WHERE outcome = 'fail'
GROUP BY 1 HAVING count(DISTINCT username) > 200
ORDER BY 1;After a run
Force a password reset and session revocation for accounts that had a successful login during the run, notify those users, and check what was done in each session.
Check yourself
Recognition and the fix. Nothing here is a procedure.
Why do per-IP rate limits miss credential stuffing?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
- 01Login CSRFA login is a state change.
- 02Breached passwords and credential stuffingA password reused from another site will be tried on yours.
- 03Password reset tokensA reset token is a password that expires.
- 04Password spraying: a few common passwords against many accountsSpraying tries one or two likely passwords across every account to stay under lockout thresholds.