Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

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 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 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.

How the three attacks spread their attempts
AttackAccounts targetedAttempts per accountSourcesTypical success
Brute forceOne, or a fewHundreds to thousandsOne or a few networksLow against a sign-in page that limits attempts, unless the password is very weak. High offline against stolen hashes of weak passwords.
Password sprayingHundreds to thousandsOne or two per password triedA few networks, sometimes spread out to look ordinaryA small share of accounts: those that use one of the common passwords tried.
Credential stuffingEveryone on a leaked list, often millionsUsually oneMany networks, often thousands of addressesA 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-resistant 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.

Two answers to repeated wrong passwords for Riley's account, compared on the same questions. Neither one sees a spray of one attempt per account.

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 authenticator, 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.

MFA 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.

Which attack pattern does this excerpt most suggest? 1 of 3
time      event           account                 source       reason
09:00:04  sign_in.failed  [email protected]     192.0.2.24   wrong password
09:00:09  sign_in.failed  [email protected]    192.0.2.25   wrong password
09:00:15  sign_in.failed  [email protected]    192.0.2.24   wrong password
09:00:22  sign_in.failed  [email protected]    192.0.2.26   wrong password
09:47:31  sign_in.failed  [email protected]     192.0.2.25   wrong password
...       hundreds of accounts within the hour, 1 or 2 failures each, same 3 sources

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

Password spraying A few failures each across many accounts, from the same three sources, is the shape of a spray. The excerpt does not show which passwords were tried, so leaked pairs are not ruled out, and only limits per source or across the service would see it.

Which attack pattern does this excerpt most suggest? 2 of 3
time      event              account               source           reason
14:22:01  sign_in.failed     [email protected]    198.51.100.77    unknown account
14:22:01  sign_in.failed     [email protected]    203.0.113.140    wrong password
14:22:02  sign_in.failed     [email protected]   192.0.2.61       unknown account
14:22:02  sign_in.succeeded  [email protected]   198.51.100.203
14:22:03  sign_in.failed     [email protected]      203.0.113.9      wrong password
...       38,000 attempts in 20 minutes, 1 per account, 2,400 sources

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

Credential stuffing One attempt per account, thousands of sources and many unknown accounts suggest a leaked list from another service. The records do not show the pairs, so the diagnosis stays provisional. The one success matters most: that account's password is known and needs a forced change.

Which attack pattern does this excerpt most suggest? 3 of 3
time      event             account              source       reason
02:10:01  sign_in.failed    [email protected]   192.0.2.15   wrong password
02:10:02  sign_in.failed    [email protected]   192.0.2.15   wrong password
02:10:04  sign_in.failed    [email protected]   192.0.2.15   wrong password
02:10:12  sign_in.failed    [email protected]   192.0.2.15   wrong password
02:10:28  sign_in.rejected  [email protected]   192.0.2.15   throttled, retry in 32s
...       attempts continue for this account only, delays growing

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

Brute-force guessing Repeated failures against one account from one source are focused guessing, and the growing delay shows the throttle slowing it. The excerpt does not show the values submitted.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

Over one hour, hundreds of Cedar accounts each get one or two failed sign-ins from the same three networks. The identity provider locks an account after five failures, and no account was locked. What would have caught the attack while it was happening? 1 of 3

Choose one answer.

Cedar considers locking any account for a day after three failed sign-ins. How could that rule hurt the people it is meant to protect? 2 of 3

Choose one answer.

To screen Riley's new password, Cedar sends a breach lookup service the first five characters of the password's hash. Why does that not tell the service Riley's password? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity