Broken Rate Limiting Explained: The Bug That Lets Attackers Brute-Force Anything
Imagine a bank vault with no limit on how many times you can try the combination. You'd just keep turning the dial until it opens. That's exactly what broken rate limiting is: a website or API that lets you try again, and again, and again, with no slowdown, no lockout, no penalty. It's one of the most common vulnerabilities in bug bounty programs — and one of the most profitable, because it turns every other small weakness into a full account takeover.
What Rate Limiting Is Supposed to Do
Rate limiting is the rule that says "you get X tries per minute, then you wait." A login page might allow 5 attempts per minute per IP address. An OTP (one-time password) form might allow 3 guesses before the code expires. A password reset endpoint might allow one request per hour per email. These limits exist because without them, attackers can automate guessing at thousands of attempts per second — and eventually, guessing works.
Where Hunters Find It Broken
1. Login forms with no limit. The classic. Try 100 wrong passwords in a row and the site never complains. Combined with a leaked password list, that's credential stuffing — and it works because nothing stops it.
2. OTP and 2FA bypass. A 6-digit OTP has one million possible codes. That sounds like a lot — until you realise an automated script can try hundreds per second. If there's no limit, the code gets guessed in minutes. Hunters have earned real bounties on this one alone, because it defeats the "second factor" entirely.
3. Password reset endpoints. No limit on reset emails means an attacker can flood your inbox — or worse, brute-force the reset token if it's short or predictable.
4. API endpoints. APIs often have no rate limit at all, especially internal or undocumented ones. A search endpoint, a coupon endpoint, a referral endpoint — anything that returns different responses for different inputs can be brute-forced.
5. Limits that only exist in the browser. Some sites enforce the limit in JavaScript — the button greys out after 3 tries. But the server never checks. A hunter bypasses it in seconds by sending requests directly with curl or Burp Suite. Client-side limits are not limits.
How to Test It (Legally)
Only test this on programs where you have written permission — a bug bounty scope, your own app, or a lab. The method is simple:
- Pick a sensitive endpoint: login, OTP verification, or password reset.
- Send the same request 20–30 times in quick succession (Burp Intruder or a small script works).
- Watch the responses. If attempt 25 gets the same fast, friendly response as attempt 1, the limit is missing or broken.
- Check for workarounds: does changing your IP reset the counter? Does adding a header like
X-Forwarded-For: 1.2.3.4reset it? Attackers rotate IPs — a limit tied only to IP is weak.
How to Fix It (For Developers)
- Limit on the server, never just the browser. The server must count and enforce — the frontend is decoration.
- Limit by account AND by IP. An attacker with a botnet has many IPs but is usually targeting one account.
- Use exponential backoff. First lockout: 1 minute. Next: 5 minutes. Then 30. Guessing gets slower and slower until it's pointless.
- Expire OTPs fast and limit guesses. A 6-digit code should allow 3–5 guesses, then expire. That makes brute-forcing mathematically impossible.
- Add CAPTCHA after a few failures. It doesn't stop a determined attacker, but it breaks cheap automation.
- Log and alert. Ten failed logins from one IP in a minute should trigger an alert, not just a silent counter.
Why This Bug Pays
Broken rate limiting rarely looks dramatic in a report — there's no shell, no database dump. But its impact is enormous: it is the key that unlocks credential stuffing, OTP bypass and account takeover. Bug bounty programs know this, which is why a clean, well-documented rate-limiting report with a working proof-of-concept regularly earns a payout. It's also a great first bug for beginners: the testing is simple, the impact is easy to explain, and the fix is clear.
Remember the golden rule: only test systems you own or have written permission to test. Rate-limit testing on a live site without permission is not research — it's an attack.



Comments
Post a Comment