Skip to content

security: enforce RESET_PASSWORD_CODE_LIVES on reset tokens - #8328

Merged
unknwon merged 3 commits into
mainfrom
GHSA-5c3f-6486-3g7g
Jun 7, 2026
Merged

unknwon merged 3 commits into
mainfrom
GHSA-5c3f-6486-3g7g

Conversation

@unknwon

@unknwon unknwon commented Jun 7, 2026 •

Copy link
Copy Markdown
Member

Password reset tokens were generated with conf.Auth.ActivateCodeLives instead of conf.Auth.ResetPasswordCodeLives. The lifetime is baked into the token at generation and re-extracted at verification, so the configured reset window was advertised in the email but never enforced.

This change introduces GenerateResetPasswordCode in internal/userx and routes SendResetPasswordMail through it via a new GenerateEmailResetPasswordCode method on the email.User interface. The verifier needs no change because it reads the embedded lifetime from the token itself.

Advisory: GHSA-5c3f-6486-3g7g

Open in Capy

unknwon added 3 commits June 6, 2026 21:08
Password reset tokens were generated with conf.Auth.ActivateCodeLives,
so the configured reset window was advertised in the email but never
enforced at verification. Reset tokens stayed valid for the full
activation lifetime.

Introduce GenerateResetPasswordCode and route SendResetPasswordMail
through it so the reset window actually applied is the configured one.
@unknwon unknwon added this to the 0.14.3 milestone Jun 7, 2026
@unknwon
unknwon merged commit 187e9c5 into main Jun 7, 2026
13 of 14 checks passed
@unknwon
unknwon deleted the GHSA-5c3f-6486-3g7g branch June 7, 2026 01:32
unknwon added a commit that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant