Description
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 client_credentials grant, validate_scopes_against_key/2 in lib/hexpm_web/controllers/api/oauth_controller.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 expand_repositories_scope/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.
Published: 2026-08-24
Score: 8.3 High
EPSS: < 1% Very Low
KEV: No
Impact: Unauthorized access to private package data.
Action: Immediate Patch
AI Analysis

Impact

The vulnerability resides in the OAuth token endpoint of the hexpm platform. An API key that possesses the generic repositories permission can exchange a client credentials token and request any repository scope that begins with "repository:". Because the organization name in the scope is never checked against the key’s principal, the key gains read access to any repository in any organization, including private packages. This flaw allows an attacker with a compromised or valid API key to retrieve confidential code without belonging to the target organization.

Affected Systems

The issue affects the hex.pm service managed by the hexpm vendor. All releases from 2025‑10‑18 up to, but not including, 2026‑08‑24 are vulnerable. Earlier versions are unaffected, and newer releases incorporate the fix.

Risk and Exploitability

With a CVSS score of 8.3 the threat is considered high. The exploit requires possession of an API key that already carries repositories permissions, which could be obtained through credential compromise or social engineering. Once the token is obtained, no further privileged access is needed to read the target organization’s private artifacts. The EPSS score is not available, and the vulnerability is not yet catalogued in CISA’s KEV list. Based on the description, it is inferred that because authentication to the token endpoint is not restricted by organization membership, an external attacker who obtains or guesses an API key could perform the attack remotely.

Generated by OpenCVE AI on August 24, 2026 at 22:02 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest hexpm update released after 2026‑08‑24, which patches the scope validation logic.
  • If an immediate patch is not possible, remove the repositories permission from all existing API keys or limit the allowed repository scopes to those that actually belong to the key’s principal.
  • Disable or tightly restrict the OAuth client_credentials grant flow for repository scopes, and enforce explicit checks of organization membership when issuing tokens.
  • Actively monitor the OAuth token issuance logs for unusually large or unexpected repository scopes and investigate any anomalies immediately.

Generated by OpenCVE AI on August 24, 2026 at 22:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 25 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 24 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Description 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 client_credentials grant, validate_scopes_against_key/2 in lib/hexpm_web/controllers/api/oauth_controller.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 expand_repositories_scope/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.
Title OAuth token exchange grants repository scopes for organizations the principal cannot access
First Time appeared Hexpm
Hexpm hexpm
Weaknesses CWE-863
CPEs cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*
Vendors & Products Hexpm
Hexpm hexpm
References
Metrics cvssV4_0

{'score': 8.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-08-25T19:53:26.196Z

Reserved: 2026-08-18T11:00:02.414Z

Link: CVE-2026-75542

cve-icon Vulnrichment

Updated: 2026-08-25T19:53:18.808Z

cve-icon NVD

Status : Deferred

Published: 2026-08-24T21:17:47.373

Modified: 2026-09-01T21:15:00.147

Link: CVE-2026-75542

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T00:00:04Z

Weaknesses