liveBook · Manning

Rate limit

As explained in Grokking Web Application Security

Rate limiting restricts the number or frequency of operations that a client can perform during a defined period.

Rate limiting restricts how often an actor can access a protected resource. On login pages, it slows brute-force attacks by delaying responses after incorrect password guesses, while usually leaving occasional human mistypes almost unaffected. section 8.8

Apply rate limiting with these practical trade-offs in mind:

  • Use progressive delays, such as exponential backoff that doubles the delay after each failure, to bog down rapid attacks. section 8.8
  • Avoid relying only on usernames: attackers can repeatedly target one account to create a lockout attack and deny service to its owner. section 8.8
  • Consider applying penalties by IP address, while accounting for shared proxies, VPNs, corporate networks, TOR, and distributed bot attacks. section 8.8
  • Use rate limits alongside CAPTCHA protection for login, sign-up, and password-reset pages rather than treating one control as sufficient. section 8.17

Login response delays

A login endpoint can return almost immediately after the first incorrect password, then impose progressively longer delays after repeated failures. A brute-force tool soon becomes too slow to continue, while a legitimate user who mistypes once experiences little disruption. section 8.8

How Grokking Web Application Security covers it

How deep it goes
Explains progressive delays, IP-based application, lockout risks, shared-address problems, and distributed-attacker limitations.
Examples
Uses exponential backoff after incorrect login guesses and per-user limits for requests to arbitrary third-party URLs.
What you can do after
Operate rate limiting to slow simple brute-force attacks while balancing account lockouts, shared IP addresses, and distributed attackers.
How it connects
Connects rate limiting to brute-force attacks, denial-of-service attacks, CAPTCHA, IP addresses, proxies, VPNs, TOR, and bot networks.

Also explained in

Compare how 14 books explain rate limit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Web Application Security. The section links point to the parts of the book it draws on.