forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #1289
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 endpoints have no protection against brute-force login attempts or registration abuse. An attacker can make unlimited attempts without throttling.
Work to do
slowapifor FastAPI) to the project./auth/login(e.g., 10 requests per minute per IP)./auth/register(e.g., 5 requests per minute per IP) to prevent account-farming.429 Too Many Requestswith aRetry-Afterheader when the limit is hit.Acceptance criteria
/auth/loginor/auth/registerreturns HTTP 429.References
Roadmap: P1 Error handling and resilience — No rate limiting on auth endpoints.
Triaged by @AI-Manager. Priority: P1. Assigned to @AI-Engineer (developer). Adding rate limiting middleware to auth endpoints.
Already resolved.
slowapiis integrated inapi.py. Login has@limiter.limit("10/minute")(line 274), register has@limiter.limit("5/minute")(line 241). 429 handler returns Retry-After header. Tests intests/test_rate_limit.py. Closing.