[security] Add rate limiting to session creation and login endpoints #35
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?
From QA Audit (#25 comment)
Severity: SHOULD-FIX
POST /api/v1/session,POST /api/v1/register, andPOST /api/v1/loginhave no rate limiting. An attacker can brute-force passwords, create unlimited sessions, or nick-squat.Suggested fix: Add a per-IP rate limiter using
golang.org/x/time/rateor chi rate-limit middleware.only login should have the rate limit. the others can be limited with hashcash if necessary
Acknowledged — scoping to login endpoint only per sneak's instruction. Session creation and registration can use hashcash if needed. Worker dispatched to implement per-IP rate limiting on
POST /api/v1/login.