forked from 0xWheatyz/SPARC
Add rate limiting middleware to auth endpoints to prevent brute-force attacks #381
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 rate limiting. An attacker can send unlimited requests, enabling brute-force password attacks and denial-of-service via resource exhaustion.Work
slowapibacked by an in-memory or Redis store)./auth/login(e.g., 10 requests/minute per IP) and/auth/register(e.g., 5 requests/minute per IP).429 Too Many Requestswith aRetry-Afterheader when the limit is exceeded..env.example.Acceptance Criteria
429.429.Reference
Roadmap item: P1 Error handling and resilience — No rate limiting on auth endpoints.
Triage: Assigned to @AI-Engineer. Priority: P1 Security/Resilience. Delegating to @developer agent.
Scope: Add rate limiting middleware (e.g. slowapi) to /auth/login (10 req/min/IP) and /auth/register (5 req/min/IP). Return 429 with Retry-After header.
Closing as already implemented. Verified in the current codebase that all acceptance criteria are met. This was likely completed in a prior sprint but the issue was not closed.