Password spraying
| Class | Authentication |
|---|---|
| Also known as | Low-and-slow attack |
| CWE | CWE-307: Improper Restriction of Excessive Authentication Attempts; CWE-521: Weak Password Requirements |
| OWASP Top 10 | A07:2025 Authentication Failures |
| MITRE ATT&CK | T1110.003 Brute Force: Password Spraying |
| Typical severity | High |
| Affects | Sign-in forms without a second factor, single sign-on portals, hosted email, SSH, VNC and database logins |
A sign-in form that locks an account after five wrong passwords stops anyone who works through a long password list on one account. It does nothing against someone who tries Winter2018 once on each of a thousand accounts. Password spraying is that second approach: the attacker takes one password, or a short list of common ones, and tests it across many accounts, so that no single account collects enough failures to lock.1 It is a form of Brute-force attack attack, also called the "low-and-slow" method.2 Most known victims had no second factor at sign-in or allowed easy-to-guess passwords, or both.2
Order of attempts
A lockout counter belongs to one account. Common policies lock after three to five bad attempts in a set period,2 and Microsoft Entra ID locks after ten by default (three in US Government tenants).3 A brute-force tool uses them up on one account. A spraying tool swaps the two loops: the password is the outer loop and the account list the inner one, so each account sees a single failure per round before the next password starts.2
round 1 anna@example.com Winter2018 wrong
round 1 ben@example.com Winter2018 wrong
round 1 carla@example.com Winter2018 signed in
...
round 2 anna@example.com Password123! wrong
round 2 ben@example.com Password123! wrongAny password prompt that can be reached from the internet can be sprayed. Documented targets include SSH on port 22, MySQL on 3306, VNC on 5900, single sign-on portals and hosted email such as Office 365.1
Passwords and account lists
The guesses are the passwords people pick under complexity rules. A rule that demands a capital letter and a digit turns password into Password1, and a required symbol makes it Password1!.4 Such strings can pass the target's own password policy.1 Typical guesses in 2018 were Winter2018 and Password123!.2
Account names come from public research. Attackers have built lists from web searches and LinkedIn, and after taking over the first few accounts, downloaded the organisation's address book from the mail system to run a larger second spray.2 A sign-in form that replies faster, or with a different message, when the email is unknown tells an attacker which accounts exist before any password is tried (see Account enumeration).5
Pacing and spread
Slowing down keeps the attempts under alert thresholds.1 A tool used by the group APT28 made about four attempts per hour on each account in its spraying mode and ran for days or weeks; a campaign tracked as Quad7 tried each account once in 24 hours.1 Sending the requests through a residential proxy network spreads them over a large pool of addresses that ordinary users also share. A per-address rate limit or an address blocklist then sees little traffic from any one source.67
Microsoft, 2023 to 2024
Microsoft detected an intrusion into its corporate systems on 12 January 2024 and attributed it to the group it calls Midnight Blizzard. Starting in late November 2023, the group had sprayed passwords to take over an account in a legacy, non-production test tenant, and from it reached a very small share of corporate mailboxes, senior leadership among them. Some emails and attachments were copied out.8 The test account had no multi-factor authentication. The attackers aimed at a limited number of accounts with few attempts each, staying under blocks triggered by failure counts, and routed the traffic through residential proxies.7 Inside, they found a legacy test OAuth application with elevated access to the corporate environment and used it to grant the Exchange Online full_access_as_app role, which allows access to mailboxes.7 Microsoft stated that no vulnerability in its products was involved.8
Signs in the logs
A spray shows in the totals across accounts. Known signs are a sudden spike in sign-in attempts over many accounts, often thousands from one address with one user agent string, runs lasting more than two hours, and employee sign-ins from locations that do not match where the employee normally works.2 Investigators filter the attack window and addresses for successful sign-ins, and count among them attempts where the password was right and only the second factor failed.9 Accounts that were targeted need new passwords, whether or not a sign-in succeeded.7 Through residential proxies the addresses change so often that searching logs for known attacker addresses misses the activity.7
Defences
A second factor stops a sprayed password from being enough on its own, and it is the strongest single defence against the attack.62 Where it cannot be required of every user, it can be required of administrators, and asked for as a step-up when one address has tried many accounts.6 See Multi-factor authentication and Passkeys and WebAuthn.
Blocking common passwords removes the guesses from the pool. New and changed passwords are checked against a list of common, expected and leaked passwords, large enough to cover what an attacker could try before the attempt limit.4 Supabase Auth can reject leaked passwords through the Have I Been Pwned Pwned Passwords service, on the Pro plan and above.10
Failure counters work at two levels. The lockout counter is tied to the account, so that switching addresses does not reset it,5 but one try per account never reaches it. A second count watches failures across accounts: per address over long windows as well as short bursts, including low, steady volumes that arrive from many addresses at once.6 Microsoft's smart lockout adds two refinements: repeating the same wrong password does not raise the counter, since it remembers the last three bad password hashes, and familiar and unfamiliar locations count separately, so an attacker elsewhere does not lock the real user out.3 See Account lockout and Rate limiting.
Prompt for a coding agent
Review the sign-in, sign-up and password-change code in this project for password spraying. 1) Check new and changed passwords against a list of common and leaked passwords; with Supabase Auth, tell me whether leaked password protection is on. 2) Keep the failed sign-in counter per account, and add a second limit on failed sign-ins per IP address across all accounts, over both one minute and 24 hours. 3) When one IP address has failed on many different accounts, require a CAPTCHA or a second factor from it. 4) Make the sign-in response identical in message and timing for an unknown email and a wrong password. 5) Require two-factor sign-in for admin accounts. List each file you changed and any limit values you picked.
In SecFlash
On a server, SecFlash reports SF-DET-402 on the Detections page when one address tries SSH logins under many user names within a few minutes, and SF-SRV-201 on the Server page when SSH accepts password logins at all. For a site behind Cloudflare, SF-CLD-307 on the Cloud page shows a zone with no rate limiting rule, so nothing at Cloudflare slows repeated requests to the sign-in page or API.
See also
- Authentication
- Brute-force attack
- Credential stuffing
- SSH brute-force attack
- Account lockout
- Multi-factor authentication
- Category: Authentication
References
- a b c d e MITRE. "Brute Force: Password Spraying, Sub-technique T1110.003". MITRE ATT&CK.
- a b c d e f g h CISA and FBI (27 March 2018, revised 6 May 2020). "Brute Force Attacks Conducted by Cyber Actors" (Alert TA18-086A). CISA.
- a b "Protect user accounts from attacks with Microsoft Entra smart lockout". Microsoft Learn. Microsoft.
- a b "NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management". NIST.
- a b "Authentication Cheat Sheet". OWASP Cheat Sheet Series.
- a b c d "Credential Stuffing Prevention Cheat Sheet". OWASP Cheat Sheet Series.
- a b c d e Microsoft Threat Intelligence (25 January 2024). "Midnight Blizzard: Guidance for responders on nation-state attack". Microsoft Security Blog.
- a b Microsoft Security Response Center (19 January 2024). "Microsoft Actions Following Attack by Nation State Actor Midnight Blizzard". MSRC Blog. Microsoft.
- back "Password spray investigation". Microsoft Learn. Microsoft.
- back "Password security". Supabase Docs. Supabase.
External links
- Authentication Cheat Sheet, OWASP Cheat Sheet Series