# What is CVE-2026-21621?

> CVE-2026-21621 is a high-severity flaw (CVSS 7.0) in Hexpm, published on 5 March 2026. It is not on the list of flaws known to be exploited today. The latest forecast puts its chance of use in the next 30 days at 0.5%. If you run an affected version, plan in the vendor’s fix.

Canonical page: https://www.edgeprotect.io/what-is/cve-2026-21621

## At a glance

- **Verdict:** Plan it in. No sign of exploitation and a low forecast. Patch it in your normal update cycle.
- **EdgeProtect risk score:** 48 out of 100 (Medium); action: Plan remediation. Kept up to date as the evidence changes.
- **Severity:** High (CVSS 7.0 out of 10)
- **Known to be exploited:** No, not on the list of flaws known to be exploited today
- **Chance of use in the next 30 days:** 0.5% (latest exploit-likelihood forecast)
- **Published:** 5 March 2026
- **Record last updated:** 20 November 2026
- **Main product:** Hexpm
- **Affected products:** 1

## What is CVE-2026-21621? In plain terms

It can be attacked from anywhere on the internet with an ordinary user account, and nobody has to click anything.

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

### What kind of flaw is it?

- CWE-863: Incorrect Authorization

### How an attack on it works

- Where an attacker can be: Anywhere on the internet
- How hard it is to pull off: Easy: no special conditions
- Login needed first: An ordinary user account
- Does someone have to click: No, nobody has to do anything

Severity vector: `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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X`

## Is CVE-2026-21621 being exploited? Not that we know of

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 0.5%. That can change at any time, which is why we keep watching.

Exploit likelihood over the last 7 days: 0.4%, 0.4%, 0.4%, 0.4%, 0.4%, 0.5%, 0.5%.

### Timeline

- 5 March 2026: Published
- 20 November 2026: Record last updated

### How EdgeProtect ranks it

CVE-2026-21621 scores **48 out of 100 (Medium)**, with the action "Plan remediation".

Every published flaw gets a risk score from 0 to 100, kept up to date as the evidence changes. Four things go into the score, from the one that counts most to the ones that count less:

- Evidence it is being exploited: biggest factor
- How severe it is: strong factor
- How widely exposed it is: key context
- Real threat activity around it: key context

85 and above is Critical. Anything confirmed as exploited is always marked for an emergency patch, whatever its score. When this flaw matches software you track, it lands in your list with its score and the reasons behind it.

## Who is affected by CVE-2026-21621?

The published record lists 1 product. Versions are as published: "2025-10-17 to before 2026-03-05" means from 2025-10-17 up to, but not including, 2026-03-05.

- [Hexpm](https://www.edgeprotect.io/product/hex/hexpm) by [Hex](https://www.edgeprotect.io/vendors/hex) (Application): 2025-10-17 to before 2026-03-05

## How do I fix CVE-2026-21621?

1. **Check whether you run it.** Compare your versions with the affected products above. Not sure what you run? EdgeProtect can work it out from your public website, or you can pick it from a list.
2. **Apply the vendor’s fix.** Install the update named in the vendor’s advisory. We’ve put the advisories and patch notes first in the list.
3. **If you can’t patch today.** Follow any mitigation the vendor publishes, and limit who can reach the affected system from the internet until the update is in.
4. **Keep an eye on it.** Track the product and we tell you as soon as we spot this flaw on the list of exploited flaws, or a jump in its exploit likelihood.

### References

- [github.com](https://github.com/hexpm/hexpm/commit/71c127afebb7ed7cc637eb231b98feb802d62999) (Patch)
- [github.com](https://github.com/hexpm/hexpm/security/advisories/GHSA-739m-8727-j6w3) (Mitigation, Vendor advisory)
- [cna.erlef.org](https://cna.erlef.org/cves/CVE-2026-21621.html)
- [github.com](https://github.com/hexpm/hexpm/commit/71829cb6f6559bcceb1ef4e43a2fb8cdd3af654b)
- [osv.dev](https://osv.dev/vulnerability/EEF-CVE-2026-21621)

## Questions

### What is CVE-2026-21621?

CVE-2026-21621 is a high-severity flaw in Hexpm, published on 5 March 2026. It can be attacked from anywhere on the internet with an ordinary user account, and nobody has to click anything.

### How serious is CVE-2026-21621?

It scores 7.0 out of 10 on the CVSS severity scale, which is high. Our risk score for CVE-2026-21621 is 48 out of 100, which is Medium. Its action is "Plan remediation". No sign of exploitation and a low forecast. Patch it in your normal update cycle.

### Is CVE-2026-21621 being exploited?

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 0.5%. That can change at any time, which is why we keep watching.

### Which versions does CVE-2026-21621 affect?

For Hexpm: 2025-10-17 to before 2026-03-05.

### How do I fix CVE-2026-21621?

Install the update the vendor names in its advisory, linked first under "How do I fix" on this page. If you can't patch today, follow the vendor's mitigation and limit who can reach the affected system from the internet.

## Does CVE-2026-21621 affect you?

EdgeProtect keeps checking for you:

- **Tell us what you run.** Pick your software from a list, or let us work it out from your website.
- **We match it to every flaw.** Over 400,000 published flaws, checked against your list.
- **Ranked by real-world risk.** Every flaw gets a 0 to 100 risk score, kept up to date, led by evidence criminals are using it.
- **Told as soon as we know.** An alert by email, in the app or by webhook to your own tools.

Start free (no card, nothing to install): https://www.edgeprotect.io/register
Book a demo: https://www.edgeprotect.io/demo

