No minimum password length — 2-character password accepted #24

Closed
opened 2026-05-14 14:30:16 +00:00 by Mark · 1 comment
Owner

Bug

The auth registration accepts a 2-character password ("ab") without any validation.

Evidence

curl -X POST http://localhost:3001/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"bad@test.com","name":"bad","password":"ab"}'

Response: HTTP 201, token and user created successfully

Impact

Combined with existing issue #13 (no rate limiting on auth endpoints), this creates a significant security risk — attackers can brute-force register accounts with trivial passwords and then attempt to compromise other users' accounts.

Severity

ORANGE High — No password policy enforcement. Related to existing #13 (no rate limiting).

Fix

Add minimum password length validation (e.g., 8 characters) in the register handler. Return 400 with a clear message.

## Bug The auth registration accepts a 2-character password ("ab") without any validation. ## Evidence ``` curl -X POST http://localhost:3001/api/auth/register \ -H "Content-Type: application/json" \ -d '{"email":"bad@test.com","name":"bad","password":"ab"}' Response: HTTP 201, token and user created successfully ``` ## Impact Combined with existing issue #13 (no rate limiting on auth endpoints), this creates a significant security risk — attackers can brute-force register accounts with trivial passwords and then attempt to compromise other users' accounts. ## Severity ORANGE **High** — No password policy enforcement. Related to existing #13 (no rate limiting). ## Fix Add minimum password length validation (e.g., 8 characters) in the register handler. Return 400 with a clear message.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-14 18:07:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#24
No description provided.