Skip to content
Web Design & Development

A Practical Guide to Rate Limiting and Brute Force Protection

Limiting how many requests a client can make in a given time, especially to login, password reset and API endpoints, to slow down automated attacks.

MediaScaleUp Editorial Team 2 min read 11 views
A Practical Guide to Rate Limiting and Brute Force Protection

The key figures

Targets
login, registration, password reset, search and API endpoints
Status code
429 Too Many Requests
Retry-After header
tells clients when they may try again
Credential stuffing
attacks using leaked passwords from other sites

Why this is worth getting right

Without limits, attackers can try thousands of passwords or overwhelm expensive endpoints, and rate limiting is a cheap, effective defense.

Do this, not that

Do

  • Rate-limit authentication endpoints by account and IP
  • Return 429 with Retry-After
  • Add multi-factor authentication for sensitive accounts
  • Monitor failed login patterns
  • Use CAPTCHA or challenges only as a last step

Don’t

  • Unlimited login attempts
  • Locking accounts permanently after a few failures
  • Limits that block legitimate shared networks
  • Error messages that reveal whether an account exists

When to bring in help

Our advice Bring in help when facing credential stuffing attacks, or when API costs spike from abusive traffic.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development