Bug: No rate limiting on login endpoint allows brute force #12
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#12
Loading…
Reference in New Issue
Block a user
No description provided.
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
POST /loginhas no rate limiting. An attacker can attempt unlimited password guesses.Impact
Brute force attacks against the admin account are trivial.
Fix
Add rate limiting middleware to the login POST endpoint. A simple approach: use
golang.org/x/time/rateorgo-chi/httprateto limit login attempts per IP (e.g. 5 attempts per minute).Location
internal/server/routes.go—/loginrouteinternal/middleware/middleware.go— add rate limit middleware