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.
Published: 2026-10-12
Score: 2.3 Low
EPSS: < 1% Very Low
KEV: No
Impact: Terminal escape sequence injection
Action: Patch
AI Analysis

Impact

Terminal escape sequence injection is an improper neutralization of escape, meta, or control sequences vulnerability in the Hex package manager. An attacker who can publish a package or control the repository can inject ANSI escape codes or Unicode bidirectional control characters into metadata fields that Hex outputs to the terminal. These unescaped sequences can change cursor position, erase output, fabricate URLs, or even write arbitrary data to the clipboard, thereby misleading users. The flaw is an instance of CWE‑150, where the program outputs data without adequately sanitizing control characters.

Affected Systems

All releases of the Hex package manager (hexpm:hex) from 0.0.1 up to, but not including, 2.5.2 are impacted. The issue is fixed in Hex 2.5.2 and later, where output from the repository registry and documentation service is now escaped and registry dependency names are validated. Environments that rely on older Hex binaries or consume package metadata from untrusted mirrors remain at risk.

Risk and Exploitability

The CVSS score of 2.3 classifies this bug as low severity. The EPSS score of 0.0037 indicates a very low probability of exploitation, and it is not listed in the CISA KEV catalog. Exploitation does not require elevated privileges or authentication; any party that can publish a malicious package or host a hostile repository can inject the control sequences. The attack vector is confined to systems that run Mix commands using the affected Hex binary, so the threat is limited to environments that fetch or trust untrusted package metadata. While it does not compromise system integrity directly, it can deface terminal output, mislead developers, and potentially expose sensitive data via clipboard writes.

Generated by OpenCVE AI on October 20, 2026 at 12:37 UTC.

Remediation

Vendor Solution

Upgrade Hex to 2.5.2 or later, for example with mix local.hex. Hex then escapes terminal control characters in text from hex.pm and the registry before printing it, and rejects registry dependencies whose package or repository name isn't a valid name.


OpenCVE Recommended Actions

  • Upgrade Hex to version 2.5.2 or later.
  • Configure Hex to use a trusted, verified registry and remove untrusted mirrors.
  • Verify package signatures before installation and avoid installing packages from unknown sources.

Generated by OpenCVE AI on October 20, 2026 at 12:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 11 Nov 2026 13:45:00 +0000


Tue, 20 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-117
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N'}

threat_severity

Moderate


Fri, 16 Oct 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 12 Oct 2026 16:00:00 +0000

Type Values Removed Values Added
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.
Title Terminal escape sequence injection in Hex via unneutralized server-supplied output
First Time appeared Hexpm
Hexpm hex
Weaknesses CWE-150
CPEs cpe:2.3:a:hexpm:hex:*:*:*:*:*:*:*:*
Vendors & Products Hexpm
Hexpm hex
References
Metrics cvssV4_0

{'score': 2.3, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-11-11T13:31:44.405Z

Reserved: 2026-08-31T00:45:02.431Z

Link: CVE-2026-81856

cve-icon Vulnrichment

Updated: 2026-10-16T17:46:18.707Z

cve-icon NVD

Status : Deferred

Published: 2026-10-12T16:17:05.827

Modified: 2026-11-11T14:17:47.253

Link: CVE-2026-81856

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-12T15:46:12Z

Links: CVE-2026-81856 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T12:45:15Z

Weaknesses
  • CWE-117

    Improper Output Neutralization for Logs

  • CWE-150

    Improper Neutralization of Escape, Meta, or Control Sequences