CVE-2026-75542: OAuth token exchange grants repository scopes for organizations the principal cannot access

Published Aug 24, 2026
·
Updated

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.

Affected Software

1 affected component
hexpm hex.pm<2026-08-24

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Update validate_scopes_against_key/2 so that requested scope strings beginning with "repository:" are validated against what the API key principal is actually allowed to access; the organization/repository name must be resolved against the principal, and expand_repositories_scope/3 must not allow an explicit repository:<name> to pass through unchanged.

    hexpm (lib/hexpm_web/controllers/api/oauth_controller.ex) validate_scopes_against_key/2 scope validation for repository scopes = Only admit repository:<name> scopes when the API key’s repositories permission is for that same organization/repository principal (do not pass through an explicit repository:<name> scope untouched)

Event History

Aug 24, 2026
CVE Published
via MITRE·08:14 PM
Data Sourced
via MITRE·08:14 PM
DescriptionWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What does an attacker need to exploit this issue?

The attacker needs an API key with the repositories permission and access to an OAuth client_credentials token exchange. They can request an explicit repository:<name> scope for another organization, without needing access to that organization.

2

Which deployments and configurations are affected?

hex.pm versions from 2025-10-18 through versions before 2026-08-24 are affected. The vulnerable path applies when API keys with the repositories permission are exchanged through the OAuth client_credentials grant.

3

What access does a successfully minted token provide?

The token provides read access to the targeted organization's private packages until the token expires. CDN edges authorize this access from the token claim and do not query the database.

4

What should be restricted if patching is not immediately possible?

Restrict or disable client_credentials exchanges for API keys carrying the repositories permission where possible. Treat any ability to request arbitrary repository:<name> scopes during token exchange as unsafe until the affected version is remediated.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203