forked from 0xWheatyz/SPARC
Security: add rate limiting to /auth/login and /auth/register endpoints #880
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
The login and registration endpoints have no protection against brute-force attacks or abuse. This is a P1 security gap before any production use.
Roadmap reference: P1 Error handling and resilience
What to do
api.py/auth.py.slowapi(FastAPI-compatible wrapper aroundlimits)./auth/login, 5 requests/minute on/auth/register.RATE_LIMIT_LOGIN,RATE_LIMIT_REGISTER).Retry-Afterheader on limit breach.Acceptance criteria
slowapi(or chosen library) is added torequirements.txt.This issue has been resolved. The changes are already merged into main.
Rate limiting added via slowapi in api.py and requirements.txt. Login and register endpoints are rate-limited.
Closing as completed.