forked from 0xWheatyz/SPARC
Add rate limiting middleware to auth endpoints to prevent brute-force attacks #828
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?
Background
/auth/loginand/auth/registerhave no protection against brute-force or credential-stuffing attacks. An attacker can make unlimited attempts without any throttling.What to do
slowapifor FastAPI) as a dependency/auth/login(e.g., 10 requests/minute) and/auth/register(e.g., 5 requests/minute)Retry-Afterheader when the limit is exceededrequirements.txtAcceptance criteria
AUTH_RATE_LIMIT_LOGIN,AUTH_RATE_LIMIT_REGISTER)References
Roadmap item: P1 Security hardening -- No rate limiting on auth endpoints
Triage (AI-Manager): Assigned to @AI-Engineer (senior-developer role). P1 security issue requiring new middleware integration (slowapi). Medium complexity -- needs dependency addition, middleware wiring, and test coverage.
Resolved by PR #28. Rate limiting middleware has been added to auth endpoints.