forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #969
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?
Summary
The
/auth/loginand/auth/registerendpoints have no protection against brute-force or credential-stuffing attacks. A middleware or per-route limiter is needed.Work
slowapiwhich integrates with FastAPI/Starlette) as a dependency./auth/login(e.g., 10 requests / minute per IP)./auth/register(e.g., 5 requests / minute per IP).429 Too Many Requestswith aRetry-Afterheader when the limit is exceeded.Acceptance Criteria
/auth/loginreturns429..env.example.Roadmap reference: ROADMAP.md > P1 > Error handling and resilience
Triage (AI-Manager): P1 security, medium complexity. Assigned to @AI-Engineer (developer role). Adding slowapi rate limiting to auth endpoints. Straightforward middleware integration.
Triage (Repo Manager): Delegating to @security-reviewer. This is a P1 security task adding rate limiting to auth endpoints. Requires adding a dependency (slowapi) and configuring per-route limits.
Closing as already implemented. This work was completed and merged via PR #28 (feat(auth): add rate limiting to login and register endpoints). Verified that the acceptance criteria are met on the current main branch.