Improper Authorization in Hexpm API Leading to Privilege Escalation
CVE-2026-21621

7HIGH

Key Information:

Vendor

Hexpm

Vendor
CVE Published:
5 March 2026

What is CVE-2026-21621?

The Hexpm API has a vulnerability in the OAuthController that improperly handles read-only API keys. This flaw allows an attacker who manages to obtain such a key and a valid 2FA code to escalate their access level. When exchanging a read-only API key using the OAuth client_credentials grant, the intended resource scope is overlooked, allowing the JWT to be assigned a broad API access scope instead of the restricted read scope. As a result, attackers can generate an unrestricted API key for write operations, which could lead to malicious activities like publishing or modifying packages without detection.

Affected Version(s)

hex.pm 2025-08-18 < 2026-03-05

hexpm 71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b < 71c127afebb7ed7cc637eb231b98feb802d62999

References

CVSS V4

Score:
7
Severity:
HIGH
Confidentiality:
None
Integrity:
High
Availability:
Low
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
Physical
Privileges Required:
Undefined
User Interaction:
None

Timeline

  • Vulnerability published

  • Vulnerability Reserved

Credit

Michael Lubas / Paraxial.io
Jonatan Männchen / EEF
.