Account Compromise: Attackers can guess weak passwords/PINs
Data Breach: Unauthorized access to sensitive information
Financial Loss: Brute forcing payment PINs, OTPs
Service Disruption: Resource exhaustion from automated attacks
API Abuse: Excessive calls to expensive endpoints
Real Example:
A 4-digit PIN has 10,000 possible combinations (0000-9999). Without rate limiting,
an attacker could try all combinations in seconds using automation. With rate limiting
of 5 attempts per 30 seconds, it would take over 16 hours to try all combinations!
๐ Rate Limiting Best Practices
Failed Login Attempts: Limit to 3-5 attempts, then lockout/captcha
Password Reset: Rate limit reset requests to prevent email bombing
OTP Verification: Max 3-5 attempts, then invalidate OTP
API Endpoints: Implement per-user and global rate limits
Account Lockout: Temporary lock after repeated failures
Progressive Delays: Increase delay with each failed attempt
CAPTCHA: Require human verification after threshold
IP-based Limiting: Track attempts by IP address
Account-based Limiting: Track attempts per account
๐ Rate Limiting Strategies
Fixed Window: X requests per fixed time period (e.g., 100/hour)
Sliding Window: More accurate, prevents burst attacks at boundaries
Token Bucket: Allows bursts but limits average rate
Leaky Bucket: Smooths out traffic spikes
Adaptive Rate Limiting: Adjusts based on user behavior/patterns
๐ก Detection Tips
Test for missing rate limiting:
Try multiple failed login attempts (10+) - are you blocked?
Request password reset multiple times - any limits?
Make rapid API calls - do you get rate limited?
Check response headers for rate limit info (X-RateLimit-*)