Description
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in hexpm hex allows a malicious package publisher to delete a directory outside the project's deps directory and extract package files into it when a developer fetches dependencies.

A package release's requirements carry an app label that names the dependency's OTP application. Hex takes this label from the repository's signed registry and uses it as the dependency's application name without validating it (Hex.RemoteConverger.deps/2, Hex.Mix.to_lock/1). Mix derives the dependency's checkout directory as deps/<app>, and Hex.SCM.update/1 runs File.rm_rf!/1 on that directory and unpacks the package into it. hex.pm only checks the label's length, so a publisher can set it to a value such as ../../target. When a project depends on such a release directly or transitively, mix deps.get or mix deps.update deletes the directory the label resolves to and writes the labelled package's files there. This happens before any dependency code is compiled.

This issue affects hex: from 0.6.0 before 2.5.2.
Published: 2026-10-12
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Filesystem Modification
Action: Immediate Patch
AI Analysis

Impact

A malicious package publisher can set the dependency’s application label to a value that resolves outside the project’s deps directory, such as ../../target. When Hex and Mix process the dependency, Mix constructs a path like deps/<app>, deletes that directory with File.rm_rf! and unpacks the package there. This path traversal, identified as CWE‑22, lets the attacker delete arbitrary directories and write files in locations beyond the intended dependency space, potentially corrupting a project’s build environment or overwriting critical files.

Affected Systems

The vulnerability is present in Hex versions from 0.6.0 through 2.5.1. It affects all projects using the hexpm hex package manager for Elixir applications. Upgrading to 2.5.2 or later removes the validation issue and restores safe dependency handling.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity. The exploitation vector is a supply‑chain attack: an attacker publishes a malicious package to hex.pm, and any developer running mix deps.get (or mix deps.update when the project depends on the package, directly or transitively) will trigger the path traversal. No additional user interaction beyond normal dependency resolution is required, and EPSS is not available, but the lack of KEV listing does not reduce the risk. Given the high impact on the file system and the ease of exploiting through Hex’s normal workflow, the likelihood of abuse is moderate to high in environments that fetch dependencies from untrusted or compromised registries.

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

Remediation

Vendor Solution

Upgrade Hex to 2.5.2 or later, for example with mix local.hex. Hex then skips package releases that give a dependency an application name other than a letter followed by letters, digits, _ and -, and warns about them. Resolution fails if no other release of the package fits the requirements.


Vendor Workaround

Before running mix deps.get on a mix.lock from an untrusted change, check that every key in mix.lock is a plain application name without /, \ or ... There's no workaround for new dependency resolution with mix deps.update or mix deps.get without a lock entry.


OpenCVE Recommended Actions

  • Upgrade Hex to version 2.5.2 or later, which rejects application names containing non‑alphanumeric characters.
  • Before running mix deps.get on an untrusted mix.lock, validate every key to ensure it contains only a plain application name without '/', '\\' or '..' sequences and reject the lock if any violations are found.
  • Do not execute mix deps.update or mix deps.get without a lock entry from an untrusted source until Hex is patched.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

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

threat_severity

Important


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

Type Values Removed Values Added
Metrics ssvc

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


Mon, 12 Oct 2026 15:45:00 +0000

Type Values Removed Values Added
Description Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in hexpm hex allows a malicious package publisher to delete a directory outside the project's deps directory and extract package files into it when a developer fetches dependencies. A package release's requirements carry an app label that names the dependency's OTP application. Hex takes this label from the repository's signed registry and uses it as the dependency's application name without validating it (Hex.RemoteConverger.deps/2, Hex.Mix.to_lock/1). Mix derives the dependency's checkout directory as deps/<app>, and Hex.SCM.update/1 runs File.rm_rf!/1 on that directory and unpacks the package into it. hex.pm only checks the label's length, so a publisher can set it to a value such as ../../target. When a project depends on such a release directly or transitively, mix deps.get or mix deps.update deletes the directory the label resolves to and writes the labelled package's files there. This happens before any dependency code is compiled. This issue affects hex: from 0.6.0 before 2.5.2.
Title Path traversal in Hex via unvalidated dependency app names
First Time appeared Hexpm
Hexpm hex
Weaknesses CWE-22
CPEs cpe:2.3:a:hexpm:hex:*:*:*:*:*:*:*:*
Vendors & Products Hexpm
Hexpm hex
References
Metrics cvssV4_0

{'score': 7.5, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-10-16T17:41:58.545Z

Reserved: 2026-10-01T09:00:02.103Z

Link: CVE-2026-96612

cve-icon Vulnrichment

Updated: 2026-10-16T17:41:45.839Z

cve-icon NVD

Status : Deferred

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

Modified: 2026-10-16T18:19:52.667

Link: CVE-2026-96612

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-12T15:39:49Z

Links: CVE-2026-96612 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-12T19:00:07Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')