CVE-2026-21622: Password Reset Tokens Do Not Expire
Summary
Insufficient Session Expiration vulnerability in hexpm hexpm/hexpm (Hexpm.Accounts.PasswordReset module) allows Account Takeover.
Password reset tokens generated via the "Reset your password" flow do not expire. When a user requests a password reset, Hex sends an email containing a reset link with a token. This token remains valid indefinitely until used. There is no time-based expiration enforced.
If a user's historical emails are exposed through a data breach (e.g., a leaked mailbox archive), any unused password reset email contained in that dataset could be used by an attacker to reset the victim's password. The attacker does not need current access to the victim's email account, only access to a previously leaked copy of the reset email.
This vulnerability is associated with program files lib/hexpm/accounts/passwordreset.ex and program routines Hexpm.Accounts.PasswordReset.canreset?/3.
This issue affects hex.pm: from 2025-08-01 before 2026-03-05; hexpm/hexpm: from 617e44c71f1dd9043870205f371d375c5c4d886d before bb0e42091995945deef10556f58d046a52eb7884.
Workarounds
Users who suspect email exposure should:
Immediately reset their password. Enable and enforce 2FA.
There is no complete mitigation without implementing token expiration.
Other sources
Insufficient Session Expiration vulnerability in hexpm hexpm/hexpm (Hexpm.Accounts.PasswordReset module) allows Account Takeover.
Password reset tokens generated via the "Reset your password" flow do not expire. When a user requests a password reset, Hex sends an email containing a reset link with a token. This token remains valid indefinitely until used. There is no time-based expiration enforced.
If a user's historical emails are exposed through a data breach (e.g., a leaked mailbox archive), any unused password reset email contained in that dataset could be used by an attacker to reset the victim's password. The attacker does not need current access to the victim's email account, only access to a previously leaked copy of the reset email.
This vulnerability is associated with program files lib/hexpm/accounts/passwordreset.ex and program routines Hexpm.Accounts.PasswordReset.canreset?/3.
This issue affects hex.pm: from 2025-08-01 before 2026-03-05; hexpm/hexpm: from 617e44c71f1dd9043870205f371d375c5c4d886d before bb0e42091995945deef10556f58d046a52eb7884.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Enable and enforce 2FA.
Hexpm accounts 2FA = enabled and enforced - Compensating control
Implement time-based expiration for password reset tokens; they currently remain valid indefinitely until used.
- Operational
Immediately reset the password of any user whose historical emails may have been exposed.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-21622?
CVE-2026-21622 has a high severity rating due to the potential for account takeover.
How do I fix CVE-2026-21622?
To fix CVE-2026-21622, update to a version of hexpm/hexpm that includes the expiration of password reset tokens.
What does CVE-2026-21622 affect?
CVE-2026-21622 affects the hexpm/hexpm application, specifically the password reset functionality.
What is the impact of CVE-2026-21622?
The impact of CVE-2026-21622 is that it allows attackers to exploit non-expired password reset tokens for account takeover.
Who is at risk for CVE-2026-21622?
Users of hexpm/hexpm who rely on email-based password resets are at risk for CVE-2026-21622.