Safeguard
Security Guides•

Account lockout or login throttling: which stops brute force better?

Lockout stops guessing but can lock real users out. Throttling slows attackers without that cost. How to choose, what OWASP says, and how to test either.

Safeguard Security Team
4 min read

Lockout blocks an account after a set number of failures, which stops guessing but lets attackers lock real users out. Throttling slows repeated attempts instead, which avoids that denial of service. Most teams combine a soft delay with a time-limited lockout, then watch for attacks spread across many accounts.

Definitions

  • Account lockout: after a threshold of failed logins, the account refuses further attempts until it unlocks by time, email link or an administrator.
  • Login throttling: each failure adds a delay, or limits attempts per account or source, without fully blocking the account.
  • Credential stuffing and password spraying: attacks that try known leaked pairs, or one common password across many accounts, so that no single account racks up many failures.

What OWASP says about lockout

The Web Security Testing Guide describes lockout as a balance between protecting accounts and protecting users from being denied access. Accounts are typically locked after 3 to 5 failed attempts. It lists a range of 5 to 10 attempts as a typical threshold, and notes that too low a threshold locks valid users out too often, while too high lets attackers make more guesses first.

Unlock options, from lowest to highest assurance, are: time-based unlock, self-service unlock by email, manual administrator unlock, and manual unlock with positive identification. The guide warns that administrator-only unlock can become a denial of service if an attacker wants to lock every user.

It also describes a scaling approach used by one managed identity service, where the lockout time grows with the number of failures, so brute force is slowed without enabling long-term lockout of the real user.

Comparison

LockoutThrottling
Stops simple guessingYesMostly, by making it slow
Risk to real usersCan be locked out on purposeLow, delays only
Defeats spraying across accountsNo, each account sees few failuresNo, unless keyed beyond the account
Needs an unlock processYesNo
Helps against stolen password listsLittleLittle

Neither control handles credential stuffing well on its own, because each stolen pair is tried once. The WSTG says lockouts that count failures only per IP can be avoided by spreading requests across many addresses, and recommends account-based protections too.

A reasonable setup

  1. Add a short, growing delay after each failure for the account.
  2. Apply a time-limited lockout at a threshold in the 5 to 10 range.
  3. Add limits keyed by source and by account, not source alone.
  4. Offer multi-factor authentication, since stolen passwords alone then fall short.
  5. Check passwords against known-leaked lists and notify users of unusual sign-in events.
  6. Log failures and alert on patterns across accounts.

The Credential Stuffing Prevention Cheat Sheet lists these kinds of defense, including multi-factor authentication, CAPTCHA, IP mitigation, device fingerprinting and identifying leaked passwords. The testing guide warns that a CAPTCHA should not replace a lockout mechanism, since a poorly built one can be bypassed.

How to test it

Use an account you can afford to lock. Fail logins four times, succeed, fail five times, then try the right password and note whether it is refused and when it unlocks. Check that the unlock link is single use. Test every route that accepts passwords, including mobile and API endpoints, since a missed endpoint defeats the whole control. For more on telling the attack types apart, see credential stuffing vs brute force vs password spraying.

Quick check

Can lockout be used against my users?

Yes. An attacker who knows usernames can trigger lockouts on purpose. Time-limited unlocks and scaling delays reduce that harm.

Does a CAPTCHA replace lockout?

No. The OWASP testing guide says a CAPTCHA may hinder brute force but should not replace a lockout mechanism, since implementation flaws can let attackers bypass it.

Safeguard's free scan at gold.safeguard.sh/scan covers the dependencies behind your authentication code.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.