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
{{ message }}
Repository navigation
sec(auth): outstanding password-reset tokens survive a password change and expiry is not enforced in SQL #526
internal/auth/service_password.go:231ChangePassword and internal/auth/store_postgres_credentials.go:11UpdateUserCredentials write the new password without clearing password_reset_token / password_reset_expiry.
internal/auth/store_postgres_credentials.go:29-34CompletePasswordReset matches on token and password hash but not on expiry.
Expiry is checked only in validateResetToken (internal/auth/service_password.go:503).
Failure scenario
A user requests a reset and the token is issued.
The user changes their password through the profile flow. The token stays valid.
The holder of the stale token completes the reset and overwrites the newer password.
The expiry gap is a window of about one bcrypt hash, not exploitable in practice.
ChangePassword and UpdateUserCredentials clear outstanding reset tokens, CompletePasswordReset enforces password_reset_expiry > NOW() in SQL, with tests for both.
Activity