forked from 0xWheatyz/SPARC
Add rate limiting to /auth/login and /auth/register endpoints #406
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 attacks or abuse. An attacker can attempt unlimited login attempts.What to do
slowapi(built onlimits) is the standard choice/auth/loginto a reasonable rate (e.g., 10 requests per minute per IP)/auth/registersimilarly (e.g., 5 per minute per IP)Retry-Afterheader when the limit is exceededAUTH_RATE_LIMIT_LOGIN,AUTH_RATE_LIMIT_REGISTER)Acceptance Criteria
/auth/loginwithin the window returns 429Retry-Afterheader is present in the 429 responseReference
Roadmap: P1 - Error handling and resilience
Triage: Already Implemented
After reviewing the codebase, this issue has already been fully implemented in the current
mainbranch.This issue can be closed.