Skip to content

Store hashed lostPasswordKey in the database#6691

Merged
BurntimeX merged 1 commit into
6.3from
63-store-hashed-lost-password-key
Jun 17, 2026
Merged

Store hashed lostPasswordKey in the database#6691
BurntimeX merged 1 commit into
6.3from
63-store-hashed-lost-password-key

Conversation

@BurntimeX

Copy link
Copy Markdown
Member

Store SHA-256 hash of the lost-password key in the database instead of the raw token. The plain key is only sent to the user via email; any later verification re-hashes the supplied value and compares against the stored hash via hash_equals.

This limits the blast radius of a database disclosure: a read-only leak of the user table (e.g. via SQL injection or stolen backup) no longer hands the attacker working password-reset tokens.

Store SHA-256 hash of the lost-password key in the database instead of the raw token. The plain key is only sent to the user via email; any later verification re-hashes the supplied value and compares against the stored hash via hash_equals.

This limits the blast radius of a database disclosure: a read-only leak of the user table (e.g. via SQL injection or stolen backup) no longer hands the attacker working password-reset tokens.
@BurntimeX BurntimeX merged commit 013eb1f into 6.3 Jun 17, 2026
6 of 8 checks passed
@BurntimeX BurntimeX deleted the 63-store-hashed-lost-password-key branch June 17, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants