Brute force means repeatedly trying passwords against one account. Without limits, a script can try thousands per minute.
How does rate limiting help?
By capping the number of allowed requests per IP or account within a time window (say, 5 attempts per minute), you slow an attack down to the point of uselessness.
Where should it be applied?
- The login page
- Registration and password reset
- OTP delivery
- Any API endpoint returning sensitive data
Another layer: 2FA
Even if a password leaks via brute force or a data breach, two-factor authentication still blocks the login.
Rate-limit sensitive endpoints and use multi-factor authentication.