# CVE-2026-81856: Terminal escape sequence injection in Hex via unneutralized server-supplied output

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** LOW 2.3
- **CVSS:** 2.3 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: Passive; Confidentiality impact: None; Integrity impact: Low; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.73% (percentile 50, 2026-11-28)
- **CWE:** CWE-150
- **Published:** 2026-10-12T15:46:12.146Z
- **Modified:** 2026-11-20T06:17:41.743Z

## Who should check

- Anyone running hexpm hex \>= 0.0.1, \< 2.5.2
- Anyone running hexpm hex \>= 211303e3f68f5d3ce06450c1ff1a7a770a9ab236, \< \*

## Description

Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in hexpm hex allows a malicious package publisher or a hostile repository server to inject terminal control sequences into the output of Mix tasks.

Hex prints strings supplied by the package repository and the documentation search service straight to the terminal through Hex.Shell.info/1 and Hex.Shell.error/1, neutralizing no control characters. Affected sinks span package metadata and configuration snippets in mix hex.info, search results in mix hex.package search and mix hex.search, owner and organization listings, publish and sponsor URLs, the authenticated username in mix hex.user, policy identities in mix hex.policy, and API error bodies rendered by Hex.Utils.print\_error\_result/1. A malicious package can embed ANSI escape sequences (cursor movement, line erase, carriage returns, OSC 52 clipboard writes) or Unicode bidirectional overrides in any of those fields, so the bytes reach the terminal unchanged, forging displayed URLs, package descriptions and suggested commands, concealing real output, or writing to the clipboard. No authentication or privileged position is required; only publishing a package.

This issue affects hex: from 0.0.1 before 2.5.2.

## Affected and fixed versions

- hexpm hex: \>= 0.0.1, \< 2.5.2 (cvelist)
- hexpm hex: \>= 211303e3f68f5d3ce06450c1ff1a7a770a9ab236, \< \* (cvelist)

## Mitigation

- Upgrade hex to 2.5.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-81856. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-81856.md
Affected: hexpm hex >= 0.0.1, < 2.5.2; hexpm hex >= 211303e3f68f5d3ce06450c1ff1a7a770a9ab236, < *
Fixed in: hexpm hex 2.5.2

Steps:
1. Search this machine and project for hexpm hex: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

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

There is no confirmed exploitation: CVE-2026-81856 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.73% chance of exploitation in the next 30 days (as of 2026-11-28).

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

Low: CVSS 2.3 (v4.0, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2026-81856?

hexpm hex \>= 0.0.1, \< 2.5.2; hexpm hex \>= 211303e3f68f5d3ce06450c1ff1a7a770a9ab236, \< \*.

### Is there a fix for CVE-2026-81856?

Yes. Fixed in hexpm hex 2.5.2. Upgrade hex to 2.5.2 or later.

### How do I check if I'm affected by CVE-2026-81856?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/hexpm/hex/security/advisories/GHSA-fpmj-3cxg-p766>
- patch: <https://github.com/hexpm/hex/commit/211303e3f68f5d3ce06450c1ff1a7a770a9ab236>
- patch: <https://github.com/hexpm/hex/commit/4a9a865c00add6985e04ce33e9c775df9cf8fc38>
- patch: <https://github.com/hexpm/hex/commit/dd3305ddf0032f6d0b468fd40dbbc3072bfcb8b8>
- other: <https://cna.erlef.org/cves/CVE-2026-81856.html>
- other: <https://osv.dev/vulnerability/EEF-CVE-2026-81856>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-81856>

HTML: <https://flawdb.com/CVE-2026-81856> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-81856>
