EEF-CVE-2026-21621

Source
https://cna.erlef.org/osv/EEF-CVE-2026-21621.html
Import Source
https://cna.erlef.org/osv/EEF-CVE-2026-21621.json
JSON Data
https://api.osv.dev/v1/vulns/EEF-CVE-2026-21621
Aliases
  • CVE-2026-21621
  • GHSA-739m-8727-j6w3
Published
2026-03-05T19:20:05.831Z
Modified
2026-03-07T03:48:46.180Z
Severity
  • 7.0 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:H/SA:N CVSS Calculator
Summary
Improper Scope Enforcement in OAuth client_credentials Flow Allows Read-Only API Key to Escalate to Full Access
Details

Incorrect Authorization vulnerability in hexpm hexpm/hexpm ('Elixir.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 client_credentials 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 'Elixir.HexpmWeb.API.OAuthController':validatescopesagainst_key/2.

This issue affects hexpm: from 71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b before 71c127afebb7ed7cc637eb231b98feb802d62999.

Database specific
{
    "cpe_ids": [
        "cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*"
    ],
    "cwe_ids": [
        "CWE-863"
    ],
    "capec_ids": [
        "CAPEC-233"
    ]
}
References
Credits
    • Michael Lubas / Paraxial.io - FINDER
    • Jonatan Männchen / EEF - REMEDIATION_DEVELOPER

Affected packages

Git / github.com/hexpm/hexpm.git

Affected ranges

Type
GIT
Repo
https://github.com/hexpm/hexpm.git
Events

Database specific

source
"https://cna.erlef.org/osv/EEF-CVE-2026-21621.json"