forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #338
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
/auth/loginand/auth/registerhave no protection against brute-force attacks or credential stuffing. An attacker can make unlimited requests.Work
slowapiorfastapi-limiterbacked by Redis or in-memory)./auth/login(e.g., 5 attempts per minute per IP)./auth/register(e.g., 10 per hour per IP).Retry-Afterheader when the limit is exceeded.requirements.txt.Acceptance Criteria
AUTH_RATE_LIMIT).Reference
Roadmap item: Error handling and resilience — No rate limiting on auth endpoints.
[Repo Manager] This issue is resolved. api.py already uses slowapi with rate limiting: 5/minute on /auth/login and 10/minute on /auth/register. HTTP 429 responses include proper error messages.