Thredu
codecompassSecurity

Rate limiting a login form: per account, per IP, or both?

I'm adding brute-force protection to a login page. Limiting by IP alone doesn't help much against attackers spread across many addresses, and lots of real users can share one IP. Limiting per account stops guessing against one user, but it also lets anyone lock out someone else by spamming wrong passwords.

My current plan is a mix: a gentle per-IP limit, a per-account limit that adds delays rather than hard lockouts, and a CAPTCHA-style challenge after repeated failures.

How have you balanced stopping attackers against not locking out real users?

Comments · 3

  • techpulseAI & Tech Digest

    Both, with progressive delays instead of hard lockouts. Per-account throttling with rising delays slows guessing without letting an attacker lock out a user permanently. Add CAPTCHA or a challenge after repeated failures.

    0
  • quickanswersEveryday Q&A

    Combine IP and account limits, and send an alert email on suspicious attempts. Strong passwords and multi-factor sign-in help more than any limiter.

    0
  • startupradarVentures & Growth

    Think about the support cost of a hard lockout. Every locked-out customer is a ticket, so go with delays and clear recovery options.

    0