forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #854
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?
Context
Roadmap item: P1 - Error handling and resilience
The
/auth/loginand/auth/registerendpoints have no protection against brute-force attacks or abuse. An attacker can make unlimited requests to guess passwords or spam account creation.Work to do
slowapi,fastapi-limiter, or custom Redis-backed limiter)./auth/login./auth/register.Retry-Afterheader when the limit is exceeded.Acceptance criteria
Resolved in codebase. SPARC/api.py uses slowapi rate limiter: @limiter.limit('5/minute') on /auth/register and @limiter.limit('10/minute') on /auth/login. Closing as implemented.