What to do about credential stuffing on a login page
Put a second login step first, then stack the defenses: refuse passwords that have already leaked, limit attempts with care, show a CAPTCHA only on risky logins, warn the user of an unusual event.
Credential stuffing is the bulk testing, on your login page, of username and password pairs stolen from another site. The OWASP prevention cheat sheet puts a second login step first, then lists defenses to stack, none of which matches the first on its own.
As of .
By Thibault Peray, founder of Antisy Sàrl. · All articles
What credential stuffing is, and what it is not
This article follows a single outside source, OWASP’s “Credential Stuffing Prevention Cheat Sheet”. The page shows neither a date nor a version: only its reading date, under this section, places it. What is between quotation marks is quoted word for word; the rest is our paraphrase, and remarks the sheet does not make are marked as ours.
Three attacks look alike and get mixed up. The sheet tells them apart like this (our words, from its table):
- brute force tests many passwords, from a dictionary or another source, against a single account;
- credential stuffing tests username and password pairs obtained from the breach of another site;
- password spraying tests a single weak password against a large number of different accounts.
So credential stuffing does not need your site to have been hacked: it feeds on people reusing the same password from one service to another. The sheet adds that, in many cases, the defenses against these attacks are the same, and that they also protect against brute force.
Sources, read on :
See: Glossary: credential stuffing · Glossary: brute force · Glossary: password spraying
The second login step first
The OWASP sheet opens its list of defenses with multi-factor authentication, that is, a second login step in addition to the password: “Multi-factor authentication (MFA) is by far the best defense against the majority of password-related attacks, including credential stuffing and password spraying” (the sentence goes on with an analysis by a software vendor, which this article does not repeat).
It adds that modern browsers and phones now support passkeys and other forms of second factor, which makes the measure attainable in most cases. So as not to weigh down every login, the second factor can be asked for only when there is reason to doubt the attempt. It cites, among others, these situations:
- a login from a new browser, device or address;
- a login from an unusual country or location;
- an address that has already tried several accounts;
- an attempt that looks like a program’s rather than a person’s.
It also provides for requiring the second factor during the session, for a sensitive action: a large financial transaction, or a privileged or administrative configuration change.
Refuse passwords that have already leaked
Credential stuffing only works when the password stolen elsewhere is also the one of the account on your site. The sheet therefore asks you to check, when a password is chosen, that it does not appear in datasets of known breaches. It notes that free and paid services can do this, names a well-known free one, and adds that you can host a copy yourself or use its API. This article names no service and has tried none: read the sheet, then the documentation of the one you pick.
Two points to settle on your side:
- check when the account is created and at every password change, and refuse with a message that says why, without blaming the person;
- decide what the form does if the check does not answer: accept or refuse, but choose it, do not let it happen.
Limit attempts without punishing a whole office
On blocking addresses, the sheet says: “Blocking IP addresses may be sufficient to stop less sophisticated attacks, but should not be used as the sole or primary defense due to the ease in circumvention.”
The reason, in our words: the sheet notes that many credential stuffing tools spread their requests over a very large number of different addresses, so the volume per address stays low even in a massive attack, which defeats both blocking addresses and limiting per address. It asks for a graduated response rather than a single, predictable limit, and for looking at both short bursts and low but steady volumes over a long period.
On the side of people who really log in, one address can hide many people, in an office, a school or on a mobile network. That remark is ours, not the sheet’s. Three precautions, the first is ours, the other two are the sheet’s:
- slow down rather than ban: a delay that grows after repeated failures and a “try again later” message; a permanent lock of an account would let anyone lock its owner out;
- make every block temporary. The sheet writes: “Mitigations, especially blocking an IP address, should be temporary and processes should be in place to remove an IP address from a mitigated state as abuse declines or stops.”
- count: the sheet asks that each defense produce volume metrics, attacks detected and attacks stopped, filterable by address, to see what it stops, to spot its failures and the attacks nobody has seen.
A CAPTCHA only for risky logins
The sheet grants that a CAPTCHA-type test at every attempt can help spot automated attacks and slow them down. But: “However, CAPTCHAs are not perfect, and in many cases tools or services exist that can be used to break them with a reasonably high success rate.”
Hence its advice: “To improve usability, it may be desirable to only require the user solve a CAPTCHA when the login request is considered suspicious or high risk, using the same criteria discussed in the MFA section.” It also suggests watching the solve rate of the tests: it shows the effect on good users, and an abnormally high rate may betray a tool that breaks them.
The cost falls on visitors. On a login, a test is part of authentication: criterion 3.3.8 of the WCAG targets exactly this case, and asks for a method without a cognitive function test unless an exception applies. The article on CAPTCHA and accessibility goes through it. A test kept for risky logins affects fewer people, but a person who cannot solve it stays locked out: give them another way in.
See: What the WCAG and the W3C say about CAPTCHA accessibility · Glossary: CAPTCHA
Tell the user about an unusual event
Telling a person can help them react, provided you do not drown them: the sheet notes that with too many messages that do not matter to them, they will start ignoring or deleting them. It gives an example of what not to report: “For example, it would generally not be appropriate to notify a user that there had been an attempt to login to their account with an incorrect password.”
And an example of what to report: “However, if there had been a login with the correct password, but which had then failed the subsequent MFA check, the user should be notified so that they can change their password.” In plain words: if the right password was entered but the second factor failed, tell the person so that they change their password, since someone else knows it. Three other points from the sheet:
- the person’s mailbox may also be compromised, since passwords are often reused from one site to another: take that into account in what you send;
- show them their recent logins: the date, time and place of their previous login attempt;
- if your application allows several sessions at once, let them see the list of active sessions and close those that are not theirs.
Where Antisy fits in
Antisy is an invisible bot check (sometimes called an “invisible CAPTCHA”). On a login, the page carries Antisy’s tag and a short token goes with each attempt; your server makes a call that ties the token to the targeted account, and reads the answer, allow or deny. There are only these two results, and the answer never gives the reason. The Node server kit that carries this call will be published; it is not yet, and the use case page tells where it stands.
If your login is under attack now, do not wait for Antisy: access is by waiting list, and the second factor, like refusing leaked passwords, depends on no Antisy service.
Antisy measures elements in the browser of the person logging in. The OWASP sheet warns that defenses that run on the visitor’s side can be imitated or bypassed, so other layers are needed: Antisy adds to the measures above and replaces none of them. It does not recognise a person who types stolen credentials by hand, announces no detection rate, and refuses a very slow device that does not finish its computation in time. Decide in advance what your login does when the API does not answer.
See: Use case: protecting a login from credential stuffing · Bot detection: telling a bot from a human · Documentation: when the API does not answer · Frequently asked questions: does Antisy stop every bot?
Where does Antisy stand?
Access is by waiting list. The API and the dashboard have been in service since 27 October 2026, hosted at Infomaniak in Geneva; no customer is in production yet. The pilot started on 9 November 2026 on our own forms.
See: The pilot · Join the waiting list
Frequently asked questions
Is a CAPTCHA enough against credential stuffing?
No. The OWASP sheet counts it among the useful but imperfect defenses, which tools can break: combine it with the other measures, and keep it, preferably, for risky logins (see above).
Do you have to require the second factor of every user?
Not necessarily. The sheet provides that an application with several roles may have different defenses for each role: “For example, it may not be feasible to enforce MFA for all users, but it should be possible to require that all administrators use it.” In plain words: requiring it of everyone is not always feasible, but requiring it of all administrators should be.
Can my site be targeted without having been hacked?
Yes. Credential stuffing uses pairs obtained from the breach of another site: it is enough that people reuse the password from elsewhere on yours. For what you owe your users if an account is taken over, ask the person who advises you on the law: this article does not cover the law.
See also: What the WCAG and the W3C say about CAPTCHA accessibility · Use case: protecting a login from credential stuffing · Bot detection: telling a bot from a human · Frequently asked questions: does Antisy stop every bot?