A07: close the Login timing oracle for unknown emails #15

Closed
opened 2026-08-13 09:35:04 +00:00 by nalum · 0 comments
Owner

Login (internal/services/user/login.go:28-51) returns a uniform "invalid credentials" message, but the not-found and blocked paths return before bcrypt.CompareHashAndPassword runs. A real account pays ~50-100ms of bcrypt, an unknown email answers about two orders of magnitude faster. Timing therefore distinguishes registered emails from unknown ones on the anonymous surface.

Fix: run bcrypt.CompareHashAndPassword against a fixed dummy hash on the miss path, then return the same error.


Source: OWASP Top 10 (2025) audit of v1.1.0, 2026-08-13. File references point at the v1.1.0 tree.

`Login` (`internal/services/user/login.go:28-51`) returns a uniform "invalid credentials" message, but the not-found and blocked paths return before `bcrypt.CompareHashAndPassword` runs. A real account pays ~50-100ms of bcrypt, an unknown email answers about two orders of magnitude faster. Timing therefore distinguishes registered emails from unknown ones on the anonymous surface. **Fix**: run `bcrypt.CompareHashAndPassword` against a fixed dummy hash on the miss path, then return the same error. --- Source: OWASP Top 10 (2025) audit of `v1.1.0`, 2026-08-13. File references point at the `v1.1.0` tree.
nalum added reference refs/tags/v1.1.0 2026-08-13 09:37:47 +00:00
nalum closed this issue 2026-08-13 11:40:10 +00:00
Sign in to join this conversation.
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
eagraiclainne/app#15
No description provided.