Guessing, spraying, and stuffing
The cheapest way into an account is to guess its password. This lesson follows the guessing that reached Cedar on Day 0: how attackers find accounts to try, the three shapes guessing takes, how to slow it without locking real people out, how to refuse passwords attackers already have, and how each shape shows up in the sign-in records.
Finding accounts to try
On an ordinary morning, Cedar's identity providerA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. records a handful of failed sign-ins. Someone mistyped a password; someone else tried last year's. On Day 0 of the incident in Why attackers go after identity, the pattern was different: within an hour, failures arrived for hundreds of Cedar accounts, one or two attempts each, all from three networks. Somebody was guessing. Before anyone can guess a password, though, they need a list of accounts to guess against.
For a workforce, that list is often easy to build. Cedar's addresses follow the pattern [email protected], and employees' names appear on the company website, in press releases and on professional profiles. Customer accounts at a consumer service such as the photo service are harder to list from outside, so attackers ask the service itself.
Sign-in, registration and password reset forms can each answer the question "does this account exist?" A sign-in page that says "No account with that email" for one address and "Wrong password" for another has answered it. So has a registration form that says "This email is already registered", or a reset page that confirms it sent a link only when the address has an account. Learning which accounts exist from a service's own responses is called account enumeration.
Timing can give the same answer when the words do not. As Passwords and PINs explained, a service checks a password with a deliberately slow hashTurning data into a short, fixed-size value called a hash, in a way that cannot be reversed and where changing one character changes the result completely. Services store password hashes instead of passwords, and signatures are made over a hash.. If it runs that hash only when the account exists, a request for a real account takes noticeably longer than one for an unknown address. Consistent responses close these gaps: the same message and status for an unknown account and a wrong password, a reset page that always says "If an account exists for this address, we've sent a link", and the same work, including a hash comparison, whatever the outcome. Registration can stay consistent too. The form always says to check your email, and someone who already has an account receives a message saying their address was used to register again, with links to sign in or reset.
Three ways to guess
With a list in hand, guessing takes three main shapes. What separates them is how the attempts are spread across accounts.
Brute force aims many passwords at one account, often thousands of guesses from one or a few sources. Against a sign-in page that limits attempts, it rarely succeeds unless the password is very short or very common. It is far more dangerous offline, against a stolen database of password hashes, where nothing limits the guesses. That is why services store passwords with the slow, salted hashing Passwords and PINs described: each guess against a stolen hash costs real time.
Password spraying tries a few common passwords against many accounts, one or two attempts each, so that no single account sees enough failures to be locked or slowed. Cedar's Day 0 wave had exactly that shape.
Credential stuffing does not guess at all. It takes email and password pairs leaked from other services and tries each pair once, relying on the reuse that Passwords and PINs warned about. Only a small share of pairs work, but across millions of pairs that is still thousands of accounts. Consumer services such as the photo service see the most of it, because their customers sign up with personal addresses that already appear in other breaches.
| Attack | Accounts targeted | Attempts per account | Sources | Typical success |
|---|---|---|---|---|
| Brute force | One, or a few | Hundreds to thousands | One or a few networks | Low against a sign-in page that limits attempts, unless the password is very weak. High offline against stolen hashes of weak passwords. |
| Password spraying | Hundreds to thousands | One or two per password tried | A few networks, sometimes spread out to look ordinary | A small share of accounts: those that use one of the common passwords tried. |
| Credential stuffing | Everyone on a leaked list, often millions | Usually one | Many networks, often thousands of addresses | A small share of pairs, which still means many accounts at that scale. |
Read the middle columns together and the defenses follow. A rule that counts failures on one account sees brute force clearly, sees a spray only as one or two failures here and there, and sees stuffing not at all, because each account is tried once.
Slowing guesses without locking people out
The obvious answer to guessing is account lockout: refuse sign-ins to an account after a set number of failures, until a timer runs out or someone authorized unlocks it. Lockout interrupts repeated guessing against one account. It has two problems. A spray stays below each account's threshold, so lockout misses Cedar's Day 0 wave entirely. And failing a sign-in takes nothing but an address, so anyone who knows Riley's address can lock Riley out on purpose, every morning if they like.
Throttling slows guesses without shutting the owner out. Each failure adds a growing delay before the next attempt is accepted, so a person who mistypes twice barely notices, while a brute-force attack slows to a few guesses an hour. The delay can apply to attempts on that account from that network, so attempts from the network doing the guessing wait longer and longer while Riley, signing in from the office, carries on. A service can also keep accepting the owner from a device that has signed in successfully before, or through a phishing-resistantA property of an authentication method that binds sign-in to the real service, so evidence entered on a look-alike site cannot be passed on and used. Passkeys have it; passwords and one-time codes do not. method that failed passwords cannot affect.
Lock the account
- After 3 wrong passwords
- Account locked
- Riley at the office
- Locked out too
- Anyone with the address
- Can lock Riley out
Owner locked out
Slow that network
- After 3 wrong passwords
- Next tries wait longer
- Riley at the office
- Still signs in
- Anyone with the address
- Slows only their own tries
Guessing slowed, owner in
A spray stays below each account's threshold, so neither rule sees it.
There is still a ceiling. NIST SP 800-63B-4, the guidance Authenticator assurance levels drew on, says that after no more than 100 consecutive failures with one authenticatorSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account., the service must disable that authenticator until the owner sets it up again. Growing delays keep both an attacker and a forgetful owner far below that ceiling, so the limit exists without becoming a tool for anyone who wants to deny access.
Limits on one account miss a spray by design, so services add other views. Source limits count how many attempts, and how many distinct accounts, come from one network. Attackers spread their traffic across many networks to stay under those too, so services also watch service-wide rates, attempts on addresses that have no account, and sudden changes in the share of sign-ins that succeed.
MFASigning in with more than one type of factor, such as a password plus a code from an enrolled authenticator app. Two passwords are still one factor type, however many screens they appear on. changes what a correct guess is worth, because a guessed password alone no longer finishes the sign-in. It still tells the attacker that the password is right. A correct password followed by a failed or abandoned second step should therefore be treated as a password that someone else knows, and changed. Getting around MFA follows what attackers try next with it.
Refusing passwords that are already known
Limits slow guessing down. They do not help when the attacker's first try is right, as in stuffing, or when the password is one of the few a sprayer tries. The stronger defense is to stop those passwords being chosen at all. When Riley sets a new password, Cedar can compare it with collections of passwords exposed in earlier breaches and with lists of the most common choices, and refuse a match. SP 800-63B-4 requires this check, and Passwords and PINs explained why it works better than rules about capital letters and symbols.
A service sees a password in readable form only when it is set or typed, since afterward it keeps just a salted hash. So screening happens then: when a password is chosen, and optionally at sign-in, when a password that has since turned up in a new breach can be flagged and changed once the sign-in is complete.
Breach collections hold billions of entries, so many services consult a lookup service instead of keeping a copy. Sending the password, or even its full hash, to that service would create a new leak. Instead, the service hashes the candidate password and sends only the first few characters of the hash. The lookup returns every breached hash that begins with those characters, often hundreds of them, and the service compares the rest itself:
digest = lookup_hash(candidate_password)
prefix, rest = digest[:5], digest[5:]
known = breach_lookup.hashes_starting_with(prefix) # hundreds of unrelated entries
if rest in known:
refuse("This password has appeared in a data breach elsewhere.")The lookup never learns which password was checked or whether it matched, because the request looks the same as one for any of the hundreds of passwords that share its prefix. This approach is often called a k-anonymity check: the real request hides among at least k others that look identical. When a password is refused, the message should say why in plain words and suggest a password manager, so that the next choice is a unique password rather than a small change to the same one.
What guessing looks like in the records
Each shape leaves a different pattern in the sign-in records, and the pattern tells you which limit should have caught it. Records never hold the passwords that were tried, so the pattern has to come from everything else: which accounts, how many attempts on each, from where, how fast, and why each attempt failed.
A long run of failures against one account suggests brute force. A few failures each across many accounts, from a few sources, suggests spraying. One attempt per account across a huge number of accounts, from many networks, suggests stuffing, especially when many attempts name addresses that have no account at all, because the leaked list came from another service. None of these is proof. Without the submitted passwords, a spray of common passwords and a slow run through leaked pairs can look alike, so a diagnosis names the evidence that would confirm it.
The successes hidden among the failures matter most. A success from a network that produced hundreds of failures in the same minutes, or a correct password followed by a failed second step, marks an account whose password someone else knows. That account needs a forced password change and a look at what happened after it was signed in, even if the rest of the attack was blocked. On Day 0, Cedar's limits slowed every attempt and none succeeded, which is why the records of that morning needed no follow-up beyond the alert.
Try reading the patterns yourself. Each excerpt below is a short piece of a fictional sign-in record.
Which pattern does this most suggest?
Simulation. These fictional excerpts show distributions of attempts, not the passwords or leaked pairs used. Choose the pattern each excerpt most suggests, then consider what additional evidence would confirm it. Answers stay in your browser.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Watch a sign-in limit slow guessing without locking the owner outRead the tenant's wrong-password and breached-password settings, reach the limit with a few wrong passwords for one person, and see a known breached password refused.