1. Resources
  2. Detection rules
  3. Password Spraying

Password Spraying detection rules

An attacker tries a few common passwords against many accounts, staying under each account's lockout limit. Detected as refused sign-ins, as one address failing for many accounts and as an ID Protection risk detection.

Platform
Microsoft Entra ID
Severity
Medium
Log source
Microsoft Entra ID sign-in logs, Microsoft Entra ID Protection risk detections
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
A list of valid user names, usually built from email addresses and other public sources, and a sign-in endpoint that accepts a password.
Impact
A valid password for one or more accounts, which is a session as the user where MFA is missing, and lockouts that interrupt the real users.
Response
For each account whose password was guessed, revoke the sessions, reset the password and remove the authentication methods registered since the first successful sign-in.
Mitigation
Require MFA for every user and block legacy authentication with Conditional Access, so that a guessed password is not enough to sign in.
Risk detection type
passwordSpray

How the attack works

A brute force attack tries many passwords against one account and is stopped by account lockout. Password spraying turns that around: the attacker tries one or a few commonly used passwords against many accounts and waits between rounds, so that no single account fails often enough to be locked. Any internet-facing sign-in for the tenant can be the target, and attackers prefer protocols that accept a password without a second factor.

Each wrong guess is an ordinary failed sign-in with error 50126 (invalid user name or password). Every tenant has those, and one of them proves nothing. Microsoft Entra smart lockout counts failures per account, separately for familiar and unfamiliar locations, and by default locks the account for one minute after 10 failed attempts, longer when the failures continue. A sign-in that arrives while the account is locked, or from an IP address that Microsoft has tied to malicious activity, is refused with error 50053. That is the one sign-in event which says on its own that the tenant's defenses had to step in.

With Microsoft Entra ID P2, ID Protection also raises a "Password spray" risk detection. Microsoft raises it only when the attacker has guessed a password correctly; unsuccessful attempts produce no detection. It is written to the risk detection log, not to the sign-in log, and a separate rule on this page reads it where that log is exported.

A third rule counts the failures themselves. It fires when one IP address fails a password sign-in (error 50126 or 50053) for ten or more different accounts within an hour. It needs nothing beyond the sign-in log, and the count and the window are starting points to adjust to the tenant. A fourth rule counts, in the same way, the usernames that do not exist in the tenant (error 50034), because a guessed or outdated list of names always contains some.

What an attacker needs

  • A list of valid user names, usually built from email addresses and other public sources.
  • A sign-in endpoint that accepts a password. Accounts without MFA, and protocols that cannot ask for it, turn one correct guess into access.

Impact

A valid password for one or more accounts. Without MFA that is a session as the user. With MFA the attacker holds the first factor and moves on to ways around the second, such as MFA fatigue. The lockouts the attack causes also interrupt the real users.

Detection rules

One IP Address Failed Password Sign-In for Many Accounts

Counts, per source IP address, the distinct users whose Microsoft Entra sign-in failed with error 50126 (invalid username or password) or 50053 (account locked by smart lockout, or sign-in blocked because of the IP address). Microsoft expects some 50126 errors in every tenant because users make mistakes; one address that fails for 10 or more different users within one hour has the shape of a password spray. The threshold and the window are starting points to tune against your own baseline, and a spray that changes its address for every few accounts stays below any per-address count. The rule reads the interactive sign-in log; run the same count over the non-interactive user sign-in log (AADNonInteractiveUserSignInLogs in Sentinel). Failed sign-ins of a federated domain are recorded by the identity provider and do not appear in the Microsoft Entra sign-in log.

Fires when one IPAddress has at least 10 different UserPrincipalName values within 1 hour.

Threshold ruleLevelMediumStatusExperimentalLog sourceMicrosoft Entra ID sign-in logs
title: Sign-In Failed With a Wrong Password or a Locked Account (Spraying Base Event)
id: af9c75f2-004c-4446-8f10-36c7e5e374f4
name: entra_failed_password_sign_in_many_accounts
status: experimental
description: >-
  Base event of the threshold rule in this file. A Microsoft Entra sign-in
  that failed with error 50126 (InvalidUserNameOrPassword, invalid username or
  password) or 50053 (the account is locked after repeated wrong sign-in
  attempts, or the request came from an IP address with malicious activity).
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType:  # string column
      - '50126'
      - '50053'
  condition: selection
level: low
---
title: One IP Address Failed Password Sign-In for Many Accounts
id: f5ddac64-20ae-45b8-9f7e-5b1d7ecd746f
status: experimental
description: >-
  Counts, per source IP address, the distinct users whose Microsoft Entra
  sign-in failed with error 50126 (invalid username or password) or 50053
  (account locked by smart lockout, or sign-in blocked because of the IP
  address). Microsoft expects some 50126 errors in every tenant because users
  make mistakes; one address that fails for 10 or more different users within
  one hour has the shape of a password spray. The threshold and the window are
  starting points to tune against your own baseline, and a spray that changes
  its address for every few accounts stays below any per-address count. The
  rule reads the interactive sign-in log; run the same count over the
  non-interactive user sign-in log (AADNonInteractiveUserSignInLogs in
  Sentinel). Failed sign-ins of a federated domain are recorded by the
  identity provider and do not appear in the Microsoft Entra sign-in log.
references:
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-user-accounts
  - https://learn.microsoft.com/en-us/security/operations/incident-response-playbook-password-spray
  - https://attack.mitre.org/techniques/T1110/003/
author: Forestall
date: 2026-11-15
tags:
  - attack.credential-access
  - attack.t1110.003
correlation:
  type: value_count
  rules:
    - entra_failed_password_sign_in_many_accounts
  group-by:
    - IPAddress
  timespan: 1h
  condition:
    field: UserPrincipalName
    gte: 10
falsepositives:
  - Addresses that many employees share, such as office egress points, VPN and secure web gateway exits and virtual desktop pools. Ordinary typing mistakes of many users arrive from one address there. Exclude your trusted named locations or give them their own higher threshold.
  - A password expiry or a forced password change for many users, after which their devices keep presenting the old password for a while.
  - Shared public addresses of mobile carriers and guest networks used by many of your users at the same time.
  - The values of 10 users and one hour are starting points, not tested limits. Measure how many distinct users normally fail per address and adjust both.
level: medium

False positives

  • Addresses that many employees share, such as office egress points, VPN and secure web gateway exits and virtual desktop pools. Ordinary typing mistakes of many users arrive from one address there. Exclude your trusted named locations or give them their own higher threshold.
  • A password expiry or a forced password change for many users, after which their devices keep presenting the old password for a while.
  • Shared public addresses of mobile carriers and guest networks used by many of your users at the same time.
  • The values of 10 users and one hour are starting points, not tested limits. Measure how many distinct users normally fail per address and adjust both.

ID Protection Detected a Password Spray

Detects the Microsoft Entra ID Protection risk detection "Password spray" (riskEventType passwordSpray). Microsoft watches password spray patterns across all Microsoft Entra tenants and raises this detection only when the attacker validated a correct password for a user of this tenant. Unsuccessful attempts do not produce it. The detection says that the password of the user is known to the attacker, not that the attacker reached any resource. It is calculated in real time or offline and needs Microsoft Entra ID P2. Risk detections reach a SIEM through the UserRiskEvents diagnostic setting of Microsoft Entra ID.

LevelHighStatusExperimentalLog sourceMicrosoft Entra ID Protection risk detections
title: ID Protection Detected a Password Spray
id: e3cf15f1-f456-4f68-8d29-ad4bd0ea16cc
status: experimental
description: >-
  Detects the Microsoft Entra ID Protection risk detection "Password spray"
  (riskEventType passwordSpray). Microsoft watches password spray patterns
  across all Microsoft Entra tenants and raises this detection only when the
  attacker validated a correct password for a user of this tenant.
  Unsuccessful attempts do not produce it. The detection says that the
  password of the user is known to the attacker, not that the attacker reached
  any resource. It is calculated in real time or offline and needs Microsoft
  Entra ID P2. Risk detections reach a SIEM through the UserRiskEvents
  diagnostic setting of Microsoft Entra ID.
references:
  - https://learn.microsoft.com/en-us/entra/id-protection/concept-identity-protection-risks
  - https://learn.microsoft.com/en-us/entra/id-protection/howto-identity-protection-investigate-risk
  - https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aaduserriskevents
  - https://attack.mitre.org/techniques/T1110/003/
author: Forestall
date: 2026-11-15
tags:
  - attack.credential-access
  - attack.t1110.003
logsource:
  product: azure
  service: riskdetection
detection:
  selection:
    RiskEventType: passwordSpray
  condition: selection
falsepositives:
  - A user who signs in from the flagged IP address as part of their normal work. Microsoft advises confirming the sign-in as safe in that case. Without that explanation, treat the password as known to an attacker.
level: high

False positives

  • A user who signs in from the flagged IP address as part of their normal work. Microsoft advises confirming the sign-in as safe in that case. Without that explanation, treat the password as known to an attacker.

Sign-In Blocked by Smart Lockout or a Malicious IP Block

Detects a sign-in that Microsoft Entra ID refused with error 50053. Microsoft documents two causes for this code: the account is locked after repeated sign-in attempts with a wrong password, or the request came from an IP address with malicious activity. One event is a blocked guessing attempt or a user with a stale password; the same source address producing it for several accounts is the pattern of a password spray. The ID Protection "Password spray" risk detection is recorded in the risk detection log, not in this field, and needs Microsoft Entra ID P2.

LevelLowStatusExperimentalLog sourceMicrosoft Entra ID sign-in logs
title: Sign-In Blocked by Smart Lockout or a Malicious IP Block
id: eb4fff89-988e-40fe-a617-8f649dc6085b
status: experimental
description: >-
  Detects a sign-in that Microsoft Entra ID refused with error 50053. Microsoft
  documents two causes for this code: the account is locked after repeated
  sign-in attempts with a wrong password, or the request came from an IP
  address with malicious activity. One event is a blocked guessing attempt or
  a user with a stale password; the same source address producing it for
  several accounts is the pattern of a password spray. The ID Protection
  "Password spray" risk detection is recorded in the risk detection log, not
  in this field, and needs Microsoft Entra ID P2.
references:
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-user-accounts
  - https://attack.mitre.org/techniques/T1110/003/
author: Forestall
date: 2026-11-14
tags:
  - attack.credential-access
  - attack.t1110.003
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: '50053'  # string column: IdsLocked
  condition: selection
falsepositives:
  - Devices and applications that keep retrying an old password after a password change (mail clients, mapped drives, phones). A single account locked from its usual location needs no more than an updated saved password.
  - Users who mistype their password repeatedly. Raise the priority only when one source address locks several accounts or the account is privileged.
level: low

False positives

  • Devices and applications that keep retrying an old password after a password change (mail clients, mapped drives, phones). A single account locked from its usual location needs no more than an updated saved password.
  • Users who mistype their password repeatedly. Raise the priority only when one source address locks several accounts or the account is privileged.

One IP Address Tried Many Usernames That Do Not Exist in the Tenant

Counts, per source IP address, the distinct usernames whose Microsoft Entra sign-in failed with error 50034 (UserAccountNotFound, the account is not in the directory). A password spray runs over a list of names that the attacker guessed from a naming pattern or took from an old breach, and part of such a list never matches an account. The same happens when somebody tests which names exist before spraying. A person who mistypes a username produces one or two of these errors. One address that fails for 10 or more different unknown usernames within one hour is working through a list. The rule complements the count of wrong passwords on this page, because it also fires when no listed name exists. Microsoft documents the error code and the columns the rule reads. It does not state that every attempt against a name that is not in the tenant reaches the tenant's sign-in log, so a silent rule is no proof that nobody tried. The threshold and the window are starting points. The rule reads the interactive sign-in log, and the same count can be run over the non-interactive user sign-in log.

Fires when one IPAddress has at least 10 different UserPrincipalName values within 1 hour.

Threshold ruleLevelMediumStatusExperimentalLog sourceMicrosoft Entra ID sign-in logs
title: Sign-In Failed Because the User Account Was Not Found (Unknown Username Base Event)
id: ac4dac79-845c-4185-86f9-fdda5e6a0c36
name: entra_sign_in_user_account_not_found
status: experimental
description: >-
  Base event of the threshold rule in this file. A Microsoft Entra sign-in
  that failed with error 50034 (UserAccountNotFound). Microsoft's error code
  reference says the error can occur because the user mistyped the username
  or isn't in the tenant.
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: '50034'  # string column
  condition: selection
level: low
---
title: One IP Address Tried Many Usernames That Do Not Exist in the Tenant
id: 5e708bbc-2d6d-4cd3-8675-df3e3586febb
status: experimental
description: >-
  Counts, per source IP address, the distinct usernames whose Microsoft Entra
  sign-in failed with error 50034 (UserAccountNotFound, the account is not in
  the directory). A password spray runs over a list of names that the
  attacker guessed from a naming pattern or took from an old breach, and part
  of such a list never matches an account. The same happens when somebody
  tests which names exist before spraying. A person who mistypes a username
  produces one or two of these errors. One address that fails for 10 or more
  different unknown usernames within one hour is working through a list. The
  rule complements the count of wrong passwords on this page, because it also
  fires when no listed name exists. Microsoft documents the error code and
  the columns the rule reads. It does not state that every attempt against a
  name that is not in the tenant reaches the tenant's sign-in log, so a
  silent rule is no proof that nobody tried. The threshold and the window are
  starting points. The rule reads the interactive sign-in log, and the same
  count can be run over the non-interactive user sign-in log.
references:
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes
  - https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs
  - https://learn.microsoft.com/en-us/security/operations/incident-response-playbook-password-spray
  - https://attack.mitre.org/techniques/T1110/003/
  - https://attack.mitre.org/techniques/T1087/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1110.003
  - attack.discovery
  - attack.t1087.004
correlation:
  type: value_count
  rules:
    - entra_sign_in_user_account_not_found
  group-by:
    - IPAddress
  timespan: 1h
  condition:
    field: UserPrincipalName
    gte: 10
falsepositives:
  - Addresses that many employees share, such as office egress points, VPN exits and virtual desktop pools, where the typing mistakes of many people arrive from one address. Exclude your trusted named locations or give them a higher threshold.
  - A domain change or a rename of many accounts, after which people and devices keep presenting the old usernames for a while.
  - An application that is configured for the wrong tenant and sends its users here. Microsoft names this cause in the description of the error.
  - The values of 10 usernames and one hour are starting points, not tested limits.
level: medium

False positives

  • Addresses that many employees share, such as office egress points, VPN exits and virtual desktop pools, where the typing mistakes of many people arrive from one address. Exclude your trusted named locations or give them a higher threshold.
  • A domain change or a rename of many accounts, after which people and devices keep presenting the old usernames for a while.
  • An application that is configured for the wrong tenant and sends its users here. Microsoft names this cause in the description of the error.
  • The values of 10 usernames and one hour are starting points, not tested limits.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Successful or MFA-interrupted sign-in from an address that sprayed

Detection hypothesisJoins two logsSequence of events

The failures of a spray are noise, a correct guess is the incident. Microsoft's password spray playbook tells responders to prioritize successful sign-ins from the attacker's addresses, then interrupted sign-ins, where the password was right and MFA stopped the attacker. Joining the spraying addresses to the later sign-ins from them finds both.

  1. Sign-in log: addresses whose password sign-ins failed with ResultType 50126 or 50053 for many distinct UserPrincipalName values, as the threshold rule on this page counts them.
  2. Interactive and non-interactive sign-in logs, from the first failure to 24 hours after the last: sign-ins from the same IPAddress with ResultType 0.
  3. Same logs and window: sign-ins from the same IPAddress with ResultType 50074 or 500121, where the first factor passed and MFA was required or failed.
  4. Alert on every account found in the second or third step, a success first, and treat its password as known.

LimitsAn office address shared by many users produces failures and successes of different people, so exclude your own egress ranges or give them their own threshold. An attacker who changes address between the spray and the use of the password is not joined. The 24 hours are a starting point.

Low and slow spray spread over many addresses

Detection hypothesisNeeds a baseline

A spray that rotates its source address stays under every count per address. Microsoft's playbook names the indicators that remain: failures with repeating attributes such as the user agent, the target application and the address block, and attempts at more regular intervals than people produce. Counting failed accounts per user agent and application across all addresses, against the tenant's own baseline, shows the campaign.

  1. Sign-in log: failed sign-ins with ResultType 50126, with UserPrincipalName, IPAddress, UserAgent, AppId and AutonomousSystemNumber.
  2. Per day, group by UserAgent and AppId, and count the distinct accounts and the distinct addresses.
  3. Compare each count with the same group over the previous 4 weeks, and keep groups far above their baseline in which each address failed for only a few accounts.
  4. Raise the priority when the addresses share an AutonomousSystemNumber or the attempts arrive at regular intervals.

LimitsA broken client or an expired password in a widely deployed application repeats failures with one user agent, but for the same accounts every day. An attacker who varies the user agent spreads the count. The 4 weeks are a starting point. With Microsoft Entra ID P2 the password spray risk detection covers the attempts that guessed a password.

Triage

  • Open the failed sign-in and read its failure reason. It tells you whether the account was locked or the source IP address was blocked for malicious activity.
  • Search the sign-in log for the same IP address. Count the accounts it tried (errors 50126 and 50053) and check whether any attempt succeeded (result 0).
  • Check the client and protocol of the attempts. Legacy protocols and unfamiliar user agents point to a tool, not a user.
  • If the same source signed in successfully to any account, treat that account as compromised. Reset the password, revoke its sessions and review the MFA methods registered on it.
  • A single user locked out from their usual device and location is normally a stale saved password; help the user update it.

Response

Once the attack is confirmed:

  1. List every account the source addresses tried, and separate the ones with a successful sign-in or a password spray risk detection from the rest.
  2. For each account whose password was guessed, revoke the sessions, reset the password and remove the authentication methods registered since the first successful sign-in from the source.
  3. Block the source addresses as a short-term measure, and expect the attacker to change them.
  4. Close the path the spray used. If the attempts went through a legacy protocol or reached accounts without MFA, block that protocol and have those accounts register MFA.
  5. Keep the targeted accounts under observation for the following days. A spray waits between rounds, so the next attempts can come later and from other addresses.

Mitigation

  • Require MFA for every user, with phishing-resistant methods for administrators, so that a guessed password is not enough to sign in.
  • Block legacy authentication with Conditional Access; those protocols cannot be challenged for MFA and are the usual target of a spray.
  • Use Microsoft Entra Password Protection (the global and custom banned password lists) to remove the passwords a spray tries first.
  • Keep smart lockout enabled. With pass-through authentication, keep the Microsoft Entra lockout threshold below the Active Directory threshold so the cloud blocks the attack before on-premises accounts lock.
  • With Microsoft Entra ID P2, apply sign-in risk and user risk policies so that a password spray detection forces MFA or a secure password change.

Frequently asked questions

The sign-in log shows a spray, so why is there no ID Protection detection?

Microsoft raises the "Password spray" risk detection only when the attacker has guessed a password correctly. Unsuccessful attempts produce no detection, and the detection needs Microsoft Entra ID P2. A spray that fails everywhere is visible only in the failed sign-ins.

Can a spray stay below the threshold rules?

Yes. Both threshold rules count the distinct users that failed from one IP address, with 10 users within one hour as a starting point. A spray that changes its address for every few accounts stays below any per-address count. Tune both values against your own baseline. The Detection logic section describes a count across all addresses, by user agent and application, for such a spray.

Does error 50053 always mean an attack?

No. Microsoft documents two causes for it, an account locked after repeated wrong passwords and a request from an IP address with malicious activity. A single user locked out from the usual device and location normally has a stale saved password. The same source producing the error for several accounts is the pattern of a spray.

Why are failed sign-ins of our federated domain missing?

Failed sign-ins of a federated domain are recorded by the identity provider and do not appear in the Microsoft Entra sign-in log. The rules on this page cannot count them. Collect the logs of the identity provider to see a spray against those accounts.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.