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.

Lesson 8 of 29 · 11 min read · practice only with authorization

Diagram

A stuffing run in login telemetry

Follow the path. One example at a time.

Step 1 of 4

Volume

Failed logins spike across many accounts, each tried once or twice.

Illustration: Volume
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.

  1. 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.
  2. 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.
  3. 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.

1 / 3

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.

  1. MapBroken authentication and login bypass: the flaws that let someone sign in as someone elseThe authentication failures behind most account takeovers — logic flaws in login and reset flows, missing rate limits, weak MFA enrollment, verbose errors, and default credentials — and a checklist to review a login flow end to end.
  1. 01Login CSRFA login is a state change.
  2. 02Breached passwords and credential stuffingA password reused from another site will be tried on yours.
  3. 03Password reset tokensA reset token is a password that expires.
  4. 04Password spraying: a few common passwords against many accountsSpraying tries one or two likely passwords across every account to stay under lockout thresholds.

Practice

  1. LabTenant deskTwo companies, one API. See what changes when the server checks ownership.

Glossary

  1. CardCredential stuffingPasswords leaked from other sites are tried at scale against your login.