You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passwords are stored as sha256(email + ":" + password) (pkg/pgsession/hash.go). That hash has no per-user salt and no work factor, so a leaked database could be brute-forced quickly. It also ties the hash to the email, which means a user can't change their email without resetting their password.
Proposal
Store new hashes as argon2id (or bcrypt) in PHC string format, $argon2id$v=19$..., so the algorithm is self-describing.
At login, try the new format first, then fall back to the legacy SHA-256. When a legacy hash matches, rehash with argon2id in the same request.
Reproduction of the current behavior: sign up, then SELECT pwdhash FROM users. It is a 64-character hex SHA-256 digest. The same email and password always produce the same hash, and no per-user salt is stored.
Passwords are stored as
sha256(email + ":" + password)(pkg/pgsession/hash.go). That hash has no per-user salt and no work factor, so a leaked database could be brute-forced quickly. It also ties the hash to the email, which means a user can't change their email without resetting their password.Proposal
$argon2id$v=19$..., so the algorithm is self-describing.Reproduction of the current behavior: sign up, then
SELECT pwdhash FROM users. It is a 64-character hex SHA-256 digest. The same email and password always produce the same hash, and no per-user salt is stored.