CVE Feed
7.0 High

Incorrect Authorization vulnerability in hexpm hexpm/hexpm (HexpmWeb.API.OAuthController module) allows Privilege Escalation.

CVE-2026-21621

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…

Assessment

CVSS
7 (v4.0)
Severity
High
EPSS
0.38% chance of exploitation in the next 30 days
Known exploited
Not listed in CISA KEV
Exploit availability
Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
Published
5 March 2026
Last updated
20 November 2026
Affected
hexpm · hexpm
Assigner
EEF

CVSS vectorCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:H/SA:N

At the source

References

Community proofs of concept

No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.

Submit a proof of concept
Before you submit *

Query this programmatically

Agents can read this through the MCP endpoint, or over HTTP:

curl https://cve.zerocrew.in/api/cve/CVE-2026-21621