Skip to content
Heist/ feed
High

Path traversal in Hex via unvalidated dependency app names

Type: advisorySource: Official CVE List1 source record

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

Announced Source revision 1
Original source ↗

CVE-2026-96612

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-96612

hex

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

hex

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "cpes": [
      "cpe:2.3:a:hexpm:hex:*:*:*:*:*:*:*:*"
    ],
    "repo": "https://github.com/hexpm/hex",
    "vendor": "hexpm",
    "modules": [
      "'Elixir.Hex.RemoteConverger'",
      "'Elixir.Hex.Mix'",
      "'Elixir.Hex.SCM'"
    ],
    "product": "hex",
    "versions": [
      {
        "status": "affected",
        "version": "0.6.0",
        "lessThan": "2.5.2",
        "versionType": "semver"
      }
    ],
    "packageURL": "pkg:otp/hex?repository_url=https:%2F%2Fgithub.com%2Fhexpm%2Fhex&vcs_url=repository_url=git%2Bhttps:%2F%2Fgithub.com%2Fhexpm%2Fhex.git",
    "packageName": "hex",
    "programFiles": [
      "lib/hex/remote_converger.ex",
      "lib/hex/mix.ex",
      "lib/hex/scm.ex"
    ],
    "defaultStatus": "unaffected",
    "programRoutines": [
      {
        "name": "'Elixir.Hex.RemoteConverger':deps/2"
      },
      {
        "name": "'Elixir.Hex.RemoteConverger':converge/2"
      },
      {
        "name": "'Elixir.Hex.Mix':to_lock/1"
      },
      {
        "name": "'Elixir.Hex.SCM':update/1"
      },
      {
        "name": "'Elixir.Hex.SCM':checkout/1"
      }
    ]
  },
  {
    "cpes": [
      "cpe:2.3:a:hexpm:hex:*:*:*:*:*:*:*:*"
    ],
    "repo": "https://github.com/hexpm/hex",
    "vendor": "hexpm",
    "modules": [
      "'Elixir.Hex.RemoteConverger'",
      "'Elixir.Hex.Mix'",
      "'Elixir.Hex.SCM'"
    ],
    "product": "hex",
    "versions": [
      {
        "status": "affected",
        "changes": [
          {
            "at": "1b3e2ae8f0dd7273a2c2625b9e50b6c67c8568fb",
            "status": "unaffected"
          },
          {
            "at": "72279a8e2004b32b20d8767ff010c117193dd02c",
            "status": "unaffected"
          }
        ],
        "version": "380f87054e1bc08ee13d2b5311bc01f98dad2fc6",
        "lessThan": "*",
        "versionType": "git"
      }
    ],
    "packageURL": "pkg:github/hexpm/hex",
    "packageName": "hexpm/hex",
    "programFiles": [
      "lib/hex/remote_converger.ex",
      "lib/hex/mix.ex",
      "lib/hex/scm.ex"
    ],
    "collectionURL": "https://github.com",
    "defaultStatus": "unaffected",
    "programRoutines": [
      {
        "name": "'Elixir.Hex.RemoteConverger':deps/2"
      },
      {
        "name": "'Elixir.Hex.RemoteConverger':converge/2"
      },
      {
        "name": "'Elixir.Hex.Mix':to_lock/1"
      },
      {
        "name": "'Elixir.Hex.SCM':update/1"
      },
      {
        "name": "'Elixir.Hex.SCM':checkout/1"
      }
    ]
  }
]
Related CVEs
CVE-2026-96612

Source reference: /cveMetadata/cveId

Publisher severity

high

Source reference: /containers/cna/metrics

Event
#32880 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement