{"id":"CVE-2026-96612","published":"2026-10-12T15:39:49Z","modified":"2026-11-19T08:20:51Z","title":"Path traversal in Hex via unvalidated dependency app names","vendor":"hexpm","product":"hex","tier":"tail","description":{"text":"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.\n\nA 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.\n\nThis issue affects hex: from 0.6.0 before 2.5.2.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.006,"percentile":0.42766,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/hexpm/hex/security/advisories/GHSA-2vjj-c5hr-6xc3","tags":["related","vendor-advisory"]},{"url":"https://cna.erlef.org/cves/CVE-2026-96612.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-96612","tags":["related"]},{"url":"https://github.com/hexpm/hex/commit/380f87054e1bc08ee13d2b5311bc01f98dad2fc6","tags":["related"]},{"url":"https://github.com/hexpm/hex/commit/1b3e2ae8f0dd7273a2c2625b9e50b6c67c8568fb","tags":["patch"]},{"url":"https://github.com/hexpm/hex/commit/72279a8e2004b32b20d8767ff010c117193dd02c","tags":["patch"]}],"priority":{"score":13.8,"factors":[{"name":"EPSS percentile","points":8.55},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"hexpm","affectedVersions":[{"vendor":"hexpm","product":"hex","versions":[">= 0.6.0, < 2.5.2"]},{"vendor":"hexpm","product":"hex","versions":[">= 380f87054e1bc08ee13d2b5311bc01f98dad2fc6"]}],"fixedVersions":[{"vendor":"hexpm","product":"hex","versions":["1b3e2ae8f0dd7273a2c2625b9e50b6c67c8568fb","72279a8e2004b32b20d8767ff010c117193dd02c"]}],"solutions":{"items":["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."],"from":"CVE.org CNA","provenance":"source"},"workarounds":{"items":["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."],"from":"CVE.org CNA","provenance":"source"},"capec":[{"id":"CAPEC-126","name":"A publisher of any package in a project's dependency tree can make mix deps.get delete a directory that the developer's account can write and that .. segments relative to deps reach, such as the project directory or its parent, and fill it with the labelled package's files. Writing attacker-chosen files into a directory whose contents are later run or loaded can lead to code execution without the developer compiling the dependency. Developers who fetch dependencies to review them before compiling, CI jobs and dependency update bots that only run mix deps.get or mix deps.update are affected."}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-10-16T17:41:34.850974Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-97508","exploited":false,"provenance":"source"}}