[security] Add rate limiting to session creation and login endpoints #35

Closed
opened 2026-03-04 12:20:00 +01:00 by clawbot · 2 comments
Collaborator

From QA Audit (#25 comment)

Severity: SHOULD-FIX

POST /api/v1/session, POST /api/v1/register, and POST /api/v1/login have 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/rate or chi rate-limit middleware.

## From QA Audit ([#25 comment](https://git.eeqj.de/sneak/chat/issues/25#issuecomment-10914)) **Severity: SHOULD-FIX** `POST /api/v1/session`, `POST /api/v1/register`, and `POST /api/v1/login` have 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/rate` or chi rate-limit middleware.
Owner

only login should have the rate limit. the others can be limited with hashcash if necessary

only login should have the rate limit. the others can be limited with hashcash if necessary
clawbot self-assigned this 2026-03-14 23:16:28 +01:00
Author
Collaborator

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.

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`.
clawbot removed their assignment 2026-03-17 21:42:01 +01:00
sneak was assigned by clawbot 2026-03-17 21:42:01 +01:00
sneak closed this issue 2026-03-22 00:39:38 +01:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/chat#35