We use cookies and similar technologies to analyze how visitors use this website so we can improve our product and your experience. See our cookie policy.

Trusted Accounts is now Atmosvere

BlogAccount security

Credential stuffing: how to detect attacks and protect logins

By Ludwig Thoma

In credential stuffing, bots test leaked passwords against your login at scale. Learn how to spot an attack and protect accounts with layered defenses.

Credential stuffing is an automated attack in which bots try usernames and passwords from other companies' data breaches against your login. It works because many people reuse the same password across services. The only reliable protection is layered: two-factor authentication, checks against known leaked passwords, and detection that tells automated login attempts apart from real users.

This article explains how an attack works, how to spot it in your data, and which measures you can put in place right away, even without an additional product.

What is credential stuffing?

The name combines "credentials" with "stuffing". Attackers take lists of email addresses and passwords stolen from another service and stuff them into your login form in bulk.

The OWASP Automated Threats to Web Applications project lists credential stuffing as its own threat (OAT-008): mass testing of stolen credentials to find out which of them are valid on another application.

It helps to separate it from related attacks:

AttackWhat the attackers knowHow it works
Credential stuffingValid email and password pairs from another serviceEach pair is tried once or a few times on your login
Brute forceOnly the username, sometimes not even thatMany passwords are tried against one account
Password sprayingA list of usernamesA few common passwords are tried against many accounts

For your defense, this means credential stuffing produces only a few failed attempts per account. A classic lockout after five wrong passwords often never triggers.

Why credential stuffing is so common

Three things make the attack cheap and effective:

  1. Reused passwords. A strong password does not help if it was already leaked at another service and the user uses it everywhere.
  2. Large amounts of leaked data. Collections from past breaches circulate freely or are traded. Have I Been Pwned shows how many accounts appear in known breaches.
  3. Ready-made tools. According to OWASP, common attack tools come with their own proxy networks that spread requests across many IP addresses.

Even if only a small share of the tested combinations work, millions of attempts make it pay off.

Who is affected and what is at stake

Every service with a login is a potential target. What attackers do with taken-over accounts depends on the business model:

  • Media and publishers: Taken-over subscription accounts are resold or shared. Paid content goes to people who never subscribed.
  • Ecommerce: Stored payment details, loyalty points, vouchers and delivery addresses are abused.
  • Platforms and marketplaces: Taken-over accounts send spam, scam messages or fake listings, trading on the trust the real account has built.
  • SaaS and portals: Attackers gain access to business data and documents.

Then there are follow-on costs: support requests, password resets, chargebacks and lost trust. If personal data is exposed, a notification duty under Art. 33 GDPR can also apply, usually within 72 hours. Whether it applies in a specific case is something to clarify with your data protection advisor.

Even without a successful takeover, the attack costs you: thousands of login requests load servers, the database and authentication services, and can slow down the login for real users.

How to detect an attack

Credential stuffing is designed to stay inconspicuous. Single requests look like normal logins. The pattern only shows in aggregate. Check for these signs:

  • More failed logins than usual, especially with the error "user does not exist". Many pairs from a breach list belong to accounts that do not exist on your site.
  • An unusual ratio of successful logins to attempts, for example at night or at times when your users are normally inactive.
  • Many different usernames from the same IP address, the same device fingerprint or the same user agent.
  • Traffic from data centers, VPNs and proxy networks instead of the internet providers your customers normally use.
  • Direct requests to the login API without first loading the login page, without executed scripts, or at perfectly regular intervals.
  • Unusual behavior after login: password, email address or delivery address changed immediately, loyalty points redeemed, or sessions started from new devices.

A single signal proves nothing. An IP address with many logins can also be a corporate network or a mobile carrier. The analysis becomes meaningful when several signals come together.

How to prevent credential stuffing: 7 measures

No single measure reliably stops credential stuffing. The OWASP Credential Stuffing Prevention Cheat Sheet also recommends combining several layers.

1. Offer and encourage two-factor authentication

According to OWASP, multi-factor authentication is by far the most effective defense against password-based attacks. A correct password alone no longer opens an account.

In practice, many customers do not turn on 2FA voluntarily. Make it mandatory at least for high-value accounts, such as administrators, merchant accounts or accounts with stored payment details. Passkeys are a user-friendly alternative because they no longer rely on a reusable password.

2. Check passwords against known breaches

The US standard NIST SP 800-63B requires that new or changed passwords be checked against a blocklist of commonly used, expected or compromised passwords. If a password is on that list, the user has to choose a different one.

One way to do this is the Pwned Passwords API from Have I Been Pwned. It uses a k-anonymity model: your server sends only the first five characters of the password hash, never the password itself.

3. Use uniform error messages

Respond to a wrong username and a wrong password with the same message and a comparable response time. Otherwise attackers can use your login to test which email addresses have an account with you. The same applies to sign-up and "forgot password".

4. Set rate limits on several levels

Limit login attempts not only per IP address, but also per account, per device and for the login endpoint as a whole. Fixed thresholds per IP address are not enough on their own, because attacks are spread across many addresses. We explain why IP lists and firewall rules alone often fall short in this article.

5. Use CAPTCHAs selectively, not everywhere

A CAPTCHA slows down simple scripts. OWASP points out, however, that there are tools and services that solve CAPTCHAs with high success rates. A CAPTCHA at every login also annoys your customers. It makes more sense to add an extra check only when a login looks risky. More on this in why reCAPTCHA is not enough for bot management.

6. Detect automated traffic at the login

Most attacks are automated. Bot detection that checks requests on the server and in the browser recognizes scripts, headless browsers and proxy networks before the password is even checked. Real users normally notice nothing.

7. Secure risky logins after the fact

Not every attack is stopped at the login. So also check what happens after sign-in:

  • Notify users about logins from new devices or locations.
  • Ask for re-confirmation before email address, password, delivery address or payment details are changed.
  • Reset sessions and force a new password when an account looks suspicious.

What to do while an attack is running

If you suspect an ongoing attack, these steps help, in this order:

  1. Watch the login endpoint: error rate, requests per minute, share of data center IP addresses.
  2. Slow things down short term: stricter rate limits and, if needed, an extra check for all logins from suspicious networks.
  3. Find affected accounts: flag successful logins during the attack window that show suspicious traits.
  4. Secure the accounts: end sessions, force a password reset, inform users.
  5. Document and assess: record the time frame, scope and affected data, and check with your data protection advisor whether a notification duty applies.

Where Atmosvere comes in

Atmosvere works at two points.

Account Shield protects login flows against account takeover and credential stuffing. It detects suspicious logins and compromised accounts based on behavioral, device and context signals. Real users sign in without an extra hurdle, and an additional check appears only when the risk is elevated. Which flows are covered depends on how you integrate login, password reset and other critical actions, and which measures you enable.

Bot Protection, part of Bot Shield, checks requests on the server and in the browser and stops automated traffic to login and API endpoints before it loads your authentication.

Neither replaces two-factor authentication or password checks. They add the layer that tells whether a human is using the login at all. Atmosvere is an Austrian company, and data is processed in the EU on European infrastructure. That matters, because a login protection sees every sign-in of your customers.

If you want to know how much automated traffic reaches your login and the rest of your site today, you can request a free bot analysis.

Conclusion

Credential stuffing does not exploit a vulnerability in your software, but your users' password habits. That is why no single setting switches it off.

What works is the combination: two-factor authentication for important accounts, checks against leaked passwords, uniform error messages, rate limits on several levels, and detection that filters out automated logins before they reach an account.

Sources

Common questions

What is the difference between credential stuffing and a brute-force attack?
A brute-force attack guesses passwords for an account, often with word lists or by systematic trial. In credential stuffing, the email and password pairs are already known because they come from a data breach at another service. The attackers only check whether the same credentials also work on your site.
Does two-factor authentication stop credential stuffing?
Yes. According to OWASP, it is the most effective single defense, because a correct password alone no longer grants access. Since many services cannot or will not make 2FA mandatory, the login itself still needs protection, such as bot detection and risk-based checks.
Is a CAPTCHA enough to stop credential stuffing?
No. A CAPTCHA slows down simple scripts, but solving services and tools can get around it, as OWASP also notes. It also gets in the way of real users at every login. A better approach is to show an extra check only when the risk is elevated.
How can I tell that my login is under attack?
Typical signs are a sudden rise in failed logins, many different usernames per IP address or device, traffic from data centers and proxy networks, and unusual times of day. Shortly afterwards, users often report changed passwords, orders they did not place, or logins they did not make.

Related posts