Credential stuffing: leaked passwords that open accounts on your site
Credential stuffing is trying email and password pairs leaked from another site on your login page. Per OWASP, the strongest defense is MFA, then layers: CAPTCHA for suspicious logins, checks against breached passwords, and user alerts.

One of your users made an account with the same email and password they used on another site that got breached. The attacker does not need to break into your site: they take the leaked list and try it line by line on your login page. This article shows what stops that attack, in order from the strongest.
What is credential stuffing?
Credential stuffing is trying username and password pairs leaked from a breach of another site on your login page. There is no guessing: the password is right, just from somewhere else.
The OWASP Credential Stuffing Prevention Cheat Sheet separates it from two close attacks:
Attack | What it tries |
|---|---|
Credential stuffing | Pairs leaked from another site |
Password spraying | One weak password against a large number of accounts |
Brute force | Many passwords against one account |
What is the strongest defense?
The strongest defense is multi-factor authentication (MFA), which the cheat sheet calls by far the best defense against the majority of password-related attacks. Even with the right password, the attacker does not have the second step.
If you do not want to ask for it on every login, the cheat sheet suggests asking conditionally: when the login comes from a new device, an unusual location, or a known anonymizing service. It also suggests asking again before high-risk actions, like a large transfer.
const risky = isNewDevice(req) || isUnusualLocation(req) || isAnonymizer(req.ip);
if (passwordOk && risky) {
return requireMfa(user);
}What if you cannot require MFA?
Without MFA, the cheat sheet says no single defense is as effective, but layered defenses together give reasonable protection:
Put a CAPTCHA on suspicious logins only. It slows bots down but can be broken, so there is no need to bother every user with it.
Keep your IP measures temporary and graduated, because proxy networks get around IP blocklists and rate limiting.
Count attempts over a short window and a long window, not with one fixed number the attacker learns to stay under.
When someone picks a new password, compare it with breached password datasets. The cheat sheet names Pwned Passwords from Have I Been Pwned as a free option, through the API or self-hosted.
When do you alert the user?
Alert the user when the password was right and the MFA check failed, because then someone has their password, and ask them to change it. As for every failed login, the cheat sheet says alerting on it only creates noise.
It also advises showing users the details of their last login, and letting them review and end their open sessions.
Where do you start now?
The lesson for us as developers: a correct password is no proof that the account owner is the one logging in, because it may have leaked from a site you have nothing to do with.
Check whether your site offers MFA, and if not, add it, even conditionally at first.
Add a Pwned Passwords check when someone signs up or changes their password.
Add a "right password, failed second step" alert, and a page for open sessions.
How to store the passwords themselves is covered in the Argon2id article. How to keep the login page from revealing who has an account is in the article on error messages and accounts. And if you want someone to test your login page the way an attacker would, that is what Muhassan does.
Your login page, what happens if someone tries a whole leaked list on it?
FAQ
What is the difference between credential stuffing and password spraying?
Credential stuffing tries username and password pairs leaked from another site. Password spraying tries one weak password against a large number of accounts.
Is blocking IP addresses enough?
No. The OWASP cheat sheet says proxy networks can get around IP blocklists and rate limiting, and advises temporary, graduated measures instead of blocking alone.
Should I alert the user on every failed login?
No. The cheat sheet says that creates noise. Alert them when the password was right and the MFA check failed, because then someone else has their password.


