Classification
- CWE-770 Allocation of Resources Without Limits or Throttling; CWE-307 Improper Restriction of Excessive Authentication Attempts; CWE-799 Improper Control of Interaction Frequency.
- OWASP API Security Top 10 2023: API4 Unrestricted Resource Consumption.
- OWASP Top 10 2021: A07 Identification and Authentication Failures for login and OTP brute force.
What to test
- Login, password reset and OTP or MFA verification: can codes or passwords be guessed at volume?
- Expensive operations: search, exports, report generation, file conversion.
- Paid side effects: SMS, email, phone calls and third-party API calls per request.
- Unbounded parameters: page size, limit, batch size, upload size.
- Bypasses: rotating X-Forwarded-For, changing case or adding parameters to make a request look new, GraphQL aliases and batching.
How it is proven safely
Proof does not require a denial of service. For authentication, show that a modest number of wrong attempts against a test account (for example, enough to exceed a reasonable threshold) all receive normal responses with no lockout, delay or challenge. For OTPs, show the attempts-per-code allowance against the code space. For resource limits, show that a large page size is honoured. Agree volumes in advance, and never test denial of service against production without explicit approval.
Remediation
Limit per account and per credential as well as per IP, since attackers rotate IPs. Lock or step up after repeated failures on login and OTP, and expire OTPs after a few attempts. Cap page sizes and batch sizes server-side. Apply cost-based limits for GraphQL. Put spending caps on SMS and email providers. Do not trust X-Forwarded-For unless set by your own proxy.
What Pentest-Swarm covers for rate limiting
Pentest-Swarm does not currently test rate limiting or brute-force resistance automatically. It deliberately rate-limits its own traffic, and its probes are capped per campaign, which is the opposite of what a rate-limit test needs.
- It does test the authentication endpoints for logic flaws such as NoSQL authentication bypass and unauthenticated access.
- It tests the APIs behind those endpoints for BOLA, mass assignment and injection.
- Its scope and rate controls make it safe to run against systems where an uncontrolled brute force would cause harm.
Where it falls short
Test rate limits with Burp Intruder, ffuf or a small script against agreed test accounts and volumes, and review limiter configuration directly, which is often faster and safer than black-box testing. For GraphQL cost limits, use a GraphQL-specific tool. Load and denial-of-service testing belong in a separate, explicitly approved exercise.
Questions
Is missing rate limiting a vulnerability?
On login, OTP and costly endpoints, yes, often medium or high. On cheap, public, read-only endpoints it is usually low.
Is IP-based rate limiting enough?
No. Attackers rotate IPs cheaply. Limit by account, credential and token as well.
How many OTP attempts should be allowed?
Few. With a six-digit code, allow a small number of attempts per code and expire it after that, combined with short lifetimes.