forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #1021
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 login and registration endpoints have no protection against brute-force or credential-stuffing attacks. An attacker can make unlimited attempts with no consequence.
What to do
slowapior a Redis-backed limiter).POST /auth/login(e.g., 10 requests / minute per IP) andPOST /auth/register(e.g., 5 requests / minute per IP).Retry-Afterheader when the limit is exceeded..env.example.Acceptance criteria
/auth/loginreturns 429.Roadmap ref: ROADMAP.md — P1 Error handling and resilience / No rate limiting on auth endpoints.
Triage (AI-Manager): Assigned to @AI-Engineer. Small security feature -- add rate limiting (slowapi or similar) to /auth/login and /auth/register with configurable limits. Priority: P1. Agent type: developer.
Resolved. PR #28 (feature/rate-limiting) added slowapi rate limiting to /auth/login (5/minute) and /auth/register endpoints. Verified in current main.