Credential stuffing
| Class | Authentication |
|---|---|
| Also known as | Password stuffing |
| Related CWE | CWE-307: Improper Restriction of Excessive Authentication Attempts CWE-308: Use of Single-factor Authentication CWE-521: Weak Password Requirements |
| OWASP Top 10 | A07:2025 Authentication Failures |
| MITRE ATT&CK | T1110.004 Brute Force: Credential Stuffing |
| Typical severity | High |
| Affects | Sign-in forms and APIs that accept a password alone; SSH, RDP, single sign-on and cloud email |
A script takes username and password pairs stolen from one service and submits them to the login forms of other services, to take over the accounts there. That is credential stuffing,1 and it succeeds wherever a person used the same password on more than one account.2
Description
Credential stuffing is a subset of brute-force attacks.1 It differs from plain brute force and from password spraying in what is tried against what:3
| Attack | What is tested |
|---|---|
| Brute force | Many passwords from a dictionary or other source against one account |
| Credential stuffing | Username and password pairs obtained from the breach of another site |
| Password spraying | One weak password against a large number of different accounts |
After the Sony breach of 2011, two thirds of the users whose data was also in the earlier Gawker breach had used the same password on both.1 Sites that use the email address as the username make stolen pairs more effective, since most people use one address for all their accounts.3
Mechanism
The attacker collects pairs from website breaches, phishing and password dump sites, and tests them against many websites with automated tools.1 Most such tools POST the credentials to the login and read success or failure from the response, without running the page's JavaScript.3 In a made-up example, Anna's email address and password leaked with a forum's user table:
POST /login HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
email=anna%40example.com&password=Summer2019A 401 response marks the pair as wrong; a redirect to the account page marks it as valid. An application with no defence against such scripts becomes a password oracle.4
Toolkits such as Sentry MBA spread the requests across proxy networks, so that each of many IP addresses sends few of them, which can defeat IP block lists and per-address rate limits.3 The failures can also lock out accounts where a lockout policy applies. The same lists are tried against SSH, RDP, MySQL and externally facing email such as Office 365.2
Impact
Credential stuffing is among the most common ways to take over accounts. A working pair lets the attacker spend stored value or make purchases, read card numbers, private messages and documents, send phishing or spam, or sell the pair as known to be valid.1
Notable incidents
23andMe (2023)
From 29 April to 27 September 2023, an attacker signed in to about 14,000 accounts at 23andMe with usernames and passwords that matched ones used on other websites and were known from earlier breaches or other sources.56 That was under 0.1% of 14 million customers. Through those accounts the attacker reached about 5.5 million DNA Relatives profiles and 1.4 million Family Tree profiles.6 BleepingComputer put the total at 6.9 million people; part of the data was posted on BreachForums.5
23andMe said it had no indication of an incident within its own systems, and that it had offered and encouraged multi-factor authentication since 2019.6 On 10 October it began requiring all customers to reset their passwords, and since 6 November 2023 every customer must sign in with two-step verification.5
Detection
Two patterns in sign-in logs point to it: many failures with pairs leaked from unrelated domains, and many failed attempts with distinct pairs from one IP address or session in a short time.2 Seeing either needs every failed login logged, with alerts to administrators.4 A login that passes the password and then fails the second factor is worth reporting to the user, who can then change the password.3
Prevention
Multi-factor authentication
Multi-factor authentication (MFA) is by far the best defence against credential stuffing; by Microsoft's analysis it would have stopped 99.9% of account compromises. Where it cannot be required of every user, it can be required of administrators and asked of others on risk signals, such as a new device or an IP address that has tried several accounts. A security question is a second knowledge factor and does not count as MFA.3
Supabase Auth offers an authenticator app or a phone message as the second factor. A restrictive row level security policy that requires the assurance level aal2 enforces it in the database; the docs warn against leaving out as restrictive:7
create policy "Policy name."
on table_name
as restrictive
to authenticated
using ((select auth.jwt()->>'aal') = 'aal2');Breached password checks
NIST SP 800-63B-4 requires new and changed passwords to be checked against a blocklist that can include passwords from earlier breaches. It forbids periodic forced changes but requires a change when there is evidence of compromise.8
The free Pwned Passwords API needs no key. The application sends the first five characters of the password's SHA-1 hash and compares the roughly 800 returned suffixes locally; Add-Padding: true pads each answer to between 800 and 1,000 records. Checking on each keystroke can let someone who sees the requests work out the password; checking once it is complete, for example on the field's blur event, avoids that.9
GET https://api.pwnedpasswords.com/range/{first 5 characters of the SHA-1 hash}
Add-Padding: trueSupabase's leaked password protection uses this API, on the Pro plan and above,10 at Authentication > Sign In / Providers > Email > Prevent use of leaked passwords.
Limits on attempts
Failed logins can be capped or met with growing delays, as long as the limit does not turn into a denial of service, and every failure gets the same answer: "Invalid username or password."4 NIST caps consecutive failures on one account at 100.8 Blocking IP addresses can stop less sophisticated attacks but is easy to get around, and tools exist that solve CAPTCHAs with a reasonably high success rate.3
Supabase Auth limits /auth/v1/token, which handles password sign-in, to 150 requests per 5 minutes by default, and answers 429 above that. The values are under Authentication > Rate Limits. A server that calls Auth for its users can be limited as one address unless it sends each user's IP in the Sb-Forwarded-For header with a secret API key.11
In Express, express-rate-limit counts requests per IP address by default, and with skipSuccessfulRequests it ignores 1xx, 2xx and 3xx responses, so only failed logins count:12
import { rateLimit } from 'express-rate-limit'
const loginLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
limit: 100,
skipSuccessfulRequests: true,
standardHeaders: 'draft-8',
legacyHeaders: false,
ipv6Subnet: 56,
})
app.post('/login', loginLimiter, loginHandler)Cloudflare's WAF documentation gives three rules, for the Business plan and above, that count failed POST requests to /login per IP address:13
| Rule | Rule applies to | Limit | Action |
|---|---|---|---|
| 1 | POST to /login | 4 per minute | Managed Challenge |
| 2 | POST to /login | 10 per 10 minutes | Managed Challenge |
| 3 | Any request to the host | 20 per hour | Block for 1 day |
Prompt for a coding agent
Review how this project signs users in. 1. Make sure every failed login returns the same message, "Invalid username or password.", with a 4xx status. 2. Limit failed logins per account and per IP address, with increasing delays: use express-rate-limit with skipSuccessfulRequests in an Express app, or check the Supabase Auth rate limits in a Supabase app (and send the Sb-Forwarded-For header with a secret key where a server calls Supabase Auth). 3. On sign-up and password change, check the new password against the Pwned Passwords range API (send only the first five characters of the SHA-1 hash, with Add-Padding: true) and refuse leaked ones; for Supabase, tell me to turn on Prevent use of leaked passwords instead. 4. Offer multi-factor authentication with an authenticator app, require it for administrators, and log every failed login. List each file you changed and anything you could not do.
In SecFlash
On the Cloud page, SecFlash reports SF-CLD-523 when a Supabase project's leaked password protection is off, SF-CLD-524 when it offers too few multi-factor options, SF-CLD-307 for a Cloudflare zone with no rate limiting rule and SF-CLD-308 for one with Bot Fight Mode off. SF-SRV-201 on the Server page reports SSH that accepts password logins.
See also
- Common types of attack on web applications
- Brute-force attack
- Phishing
- Multi-factor authentication
- Rate limiting
- SSH brute-force attack
- Responding to an administrator account takeover
- Category: Authentication
References
- a b c d e "Credential stuffing". OWASP Community. OWASP Foundation.
- a b c "Brute Force: Credential Stuffing, Sub-technique T1110.004". MITRE ATT&CK. MITRE (version 1.7, last modified 12 May 2026).
- a b c d e f g "Credential Stuffing Prevention Cheat Sheet". OWASP Cheat Sheet Series.
- a b c "A07:2025 Authentication Failures". OWASP Top 10:2025. OWASP Foundation.
- a b c Gatlan, Sergiu (25 January 2024). "23andMe data breach: Hackers stole raw genotype data, health reports". BleepingComputer.
- a b c 23andMe (6 October 2023, updated to 5 December 2023). "Addressing Data Security Concerns - Action Plan". 23andMe Blog.
- back "Multi-Factor Authentication". Supabase Docs. Supabase.
- a b "NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management". NIST (2025).
- back "API v3", section Pwned Passwords. Have I Been Pwned.
- back "Password security". Supabase Docs. Supabase.
- back "Rate limits". Supabase Docs. Supabase.
- back "express-rate-limit" (README). GitHub.
- back "Rate limiting best practices". Cloudflare WAF docs. Cloudflare.
External links
- Credential Stuffing Prevention Cheat Sheet, OWASP Cheat Sheet Series