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.
Summary
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in hexpm hexpm/hexpm ('Elixir.HexpmWeb.SharedAuthorizationView' modules) allows Cross-Site Scripting (XSS).
This vulnerability is associated with program files lib/hexpmweb/views/sharedauthorizationview.ex and program routines 'Elixir.HexpmWeb.SharedAuthorizationView':rendergroupedscopes/3.
This issue affects hex.pm: from 2025-10-01 before 2026-01-19; hexpm/hexpm: from 617e44c71f1dd9043870205f371d375c5c4d886d before c692438684ead90c3bcbfb9ccf4e63c768c668a8.
Summary
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in hexpm hexpm/hexpm (Hexpm.Store.Local module) allows Relative Path Traversal.
This vulnerability is associated with program files lib/hexpm/store/local.ex and program routines Hexpm.Store.Local.get/3, Hexpm.Store.Local.put/4, Hexpm.Store.Local.delete/2, Hexpm.Store.Local.deletemany/2.
This issue does NOT affect hex.pm the service. Only self-hosted deployments using the Local Storage backend are affected.
This issue affects hexpm/hexpm: from 931ee0ed46fa89218e0400a4f6e6d15f96406050 before 5d2ccd2f14f45a63225a73fb5b1c937baf36fdc0.
Workarounds
Avoid the local file store backend in any exposed environment. Restrict network access to the registry when using the local backend. Production deployments should use object storage (e.g., S3-compatible backends) instead of the local filesystem store.
Configurations
Only self-hosted hexpm deployments using the Hexpm.Store.Local storage backend are affected. The hex.pm service and deployments using S3-compatible object storage backends are not affected.
Summary
Uncontrolled Resource Consumption vulnerability in hexpm hexpm/hexpm allows Excessive Allocation.
Publishing an oversized package can cause Hex.pm to run out of memory while extracting the uploaded package tarball. This can terminate the affected application instance and result in a denial of service for package publishing and potentially other package-processing functionality.
This issue affects hex.pm: before 2026-03-10; hexpm/hexpm: from 82911daf5f8fb2ab44f298e3ba22b90bc1ae3746 before 495f01607d3eae4aed7ad09b2f54f31ec7a7df01.
Workarounds
Prevent large package uploads by enforcing upload size limits at the reverse proxy or load balancer level.
Summary
Incorrect Authorization vulnerability in hexpm hexpm/hexpm (HexpmWeb.API.OAuthController module) allows Privilege Escalation.
An API key created with read-only permissions (domain: "api", resource: "read") can be escalated to full write access under specific conditions.
When exchanging a read-only API key via the OAuth clientcredentials grant, the resource qualifier is ignored. The resulting JWT receives the broad "api" scope instead of the expected "api:read" scope. This token is therefore treated as having full API access.
If an attacker is able to obtain a victim's read-only API key and a valid 2FA (TOTP) code for the victim account, they can use the incorrectly scoped JWT to create a new full-access API key with unrestricted API permissions that does not expire by default and can perform write operations such as publishing, retiring, or modifying packages.
This vulnerability is associated with program files lib/hexpmweb/controllers/api/oauthcontroller.ex and program routines HexpmWeb.API.OAuthController.validatescopesagainstkey/2.
This issue affects hex.pm: from 2025-08-18 before 2026-03-05; hexpm/hexpm: from 71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b before 71c127afebb7ed7cc637eb231b98feb802d62999.
Workarounds
Revoke and reissue exposed API keys immediately if compromise is suspected. Avoid relying on read-only API keys as a strict security boundary in high-risk environments. Closely monitor audit logs for unexpected API key creation events. Enforce strong 2FA hygiene and protect TOTP seeds carefully.
There is no complete mitigation without upgrading, as the issue exists in server-side scope validation logic.
Summary
Incorrect Authorization vulnerability in the OAuth token endpoint in hexpm hexpm allows an API key holding the repositories permission to read another organization's private packages.
When an API key is exchanged for a token through the OAuth clientcredentials grant, validatescopesagainstkey/2 in lib/hexpmweb/controllers/api/oauthcontroller.ex admits a requested scope whenever the key carries the repositories permission and the scope string begins with repository:. The organization name is never resolved against the principal, and expandrepositoriesscope/3 only rewrites the literal repositories scope, so an explicit repository:<name> passes through untouched. Both CDN edges authorize repository access from the token claim without querying the database, so the minted token is read access to that organization's private packages until it expires.
This issue affects hex.pm: from 2025-10-18 before 2026-08-24; hexpm/hexpm: from 71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b before bf0fb9d208f0acfabf7a2f7467c8231659e322a8.