fix(auth): keep recovery code valid after password change #82
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/wonderful-perlman-083ccd"
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?
change-password rotated dek_salt but left recovery_encrypted_dek
untouched, while reset-password derived the recovery KEK from the
current dek_salt. Any password change therefore permanently broke the
recovery code: the derived KEK could never match the one that wrapped
recovery_encrypted_dek, and reset-password always failed InvalidToken.
Fix: give the recovery wrap its own salt.
that never rotates; dek_salt remains free to rotate on password change
recovery KEK was derived from it), and change-password materializes
that fallback before rotating the salt out from under it
through a stateful repo mock that actually persists credential updates
Co-Authored-By: Claude Fable 5 noreply@anthropic.com