fix(server): login timing oracle — verify a dummy hash for unknown usernames #139
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?
Review finding L1 (2026-07-06).
login(solitaire_server/src/auth.rs) returnsInvalidCredentialsimmediately when the username doesn't exist, but pays a full bcrypt verify when it does — response timing distinguishes valid from invalid usernames (user enumeration). Fix: when the user row is missing, verify the supplied password against a static dummy bcrypt hash before returning 401, so both paths cost the same.Principle: authentication failure paths should be indistinguishable — same status, same message, same time.
🤖 Generated with Claude Code