BREACHSPIDER
CVE databaseVendorsIntelFeaturesDevelopersDocsPricingSign inStart free trial

CVE-2026-21621 in Hexpm

Medium 5.3

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 ...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.15.3
CVSS v47.0
EPSS0.5%
EPSS percentile36th
FixUnknown

Remotely exploitable over the network, high complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, no confidentiality impact, full integrity impact, no availability impact.

Affected products and versions

VendorProductAffected versions
Hex Hexpm ≥ 2025-10-17, < 2026-03-05

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

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 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/hexpm_web/controllers/api/oauth_controller.ex and program routines HexpmWeb.API.OAuthController.validate_scopes_against_key/2. This issue affects hex.pm: from 2025-08-18 before 2026-03-05; hexpm/hexpm: from 71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b before 71c127afebb7ed7cc637eb231b98feb802d62999.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2026-21621
BreachSpider IDBS-2026-GLOBAL-274595-M
CVSS vectorCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
Published2026-03-05
Last modified2026-11-20
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-863: Incorrect Authorization

Software performs an authorization check incorrectly, allowing access beyond intended privileges.

Analysis AI-written, not human-reviewed

A vulnerability in the hexpm/hexpm 'Elixir.HexpmWeb.API.OAuthController' module allows for privilege escalation by exchanging a read-only API key to gain full write access.

The vulnerability occurs when a read-only API key is used with the OAuth client_credentials grant, where the resource qualifier is ignored, leading to unauthorized elevation of permissions.

Questions

What is CVE-2026-21621?

A vulnerability in the hexpm/hexpm 'Elixir.HexpmWeb.API.OAuthController' module allows for privilege escalation by exchanging a read-only API key to gain full write access.

What is the CVSS score for CVE-2026-21621?

CVE-2026-21621 has CVSS 5.3 (Medium). Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N. EPSS: 0.5%.

Is CVE-2026-21621 actively exploited?

No confirmed active exploitation of CVE-2026-21621 as of 2026-11-21.

How do I remediate CVE-2026-21621?

Priority: HIGH.

What systems are affected by CVE-2026-21621?

CVE-2026-21621 affects Hex Hexpm.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Hex","product":"Hexpm","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-11-20.