Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-103060 Overview
CVE-2026-103060 is a path traversal vulnerability in rebar3, the standard build tool for Erlang/OTP projects. A malicious package publisher on the Hex registry can craft a dependency release whose app field contains traversal sequences such as ../../../../target. When a developer runs rebar3 get-deps, the tool uses this attacker-controlled value as the dependency's directory name without validation. The vulnerable code path first deletes the resolved directory with rm -rf and then extracts the package contents into it. This gives a package publisher arbitrary file deletion and file write primitives outside the project's _build directory on any developer or CI machine that pulls the dependency directly or transitively.
Critical Impact
A malicious Hex package can delete arbitrary directories and plant files anywhere the rebar3 process has write access, enabling supply-chain compromise of Erlang build environments.
Affected Products
- Erlang rebar3 from version 3.7.0-rc1 up to (but not including) 3.27.2
- Projects consuming Hex packages published before the hex.pm server-side restriction on 2026-10-12
- CI/CD pipelines and developer workstations running rebar3 get-deps against untrusted dependency trees
Discovery Timeline
- 2026-10-12 - hex.pm begins restricting the app field to plain directory names
- 2026-10-12 - CVE-2026-103060 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-103060
Vulnerability Analysis
The flaw lives in how rebar3 consumes dependency metadata returned by a Hex registry. Each release carries an app field naming the dependency's OTP application. rebar_packages:parse_deps/1 reads this field and passes it on as the dependency's name without sanitization. rebar_app_utils:dep_to_app/7 then uses the same unvalidated string to construct the dependency's on-disk directory under _build. Finally, rebar_fetch:download_source_online/2 deletes that computed directory with rm -rf and extracts the fetched tarball into it.
Because the destination path is built by concatenation rather than resolved and verified against the project root, traversal sequences escape the intended _build subtree. The deletion and extraction happen during dependency resolution, before the dependency's own rebar.config.script runs and before any compilation. No build steps or user confirmation are required to trigger the primitive, classifying the issue under [CWE-22].
Root Cause
The root cause is missing validation that a dependency name is a plain directory component. rebar3 trusted a value fully controlled by the package publisher and used it directly in filesystem operations. The server-side registry (hex.pm) also did not reject non-directory values in the app field prior to 2026-10-12, so malicious releases could be published and distributed normally.
Attack Vector
An attacker publishes a Hex package whose release metadata sets app to a traversal payload such as ../../../../target. Any project that depends on the release, directly or transitively, triggers the primitive on rebar3 get-deps. The resolved target directory is deleted with rm -rf and the attacker's tarball contents are written in its place. On developer workstations and CI runners, this enables arbitrary file deletion and attacker-controlled file placement outside _build, which can be chained into code execution by overwriting shell startup files, build scripts, or scheduled task definitions.
// Patch excerpt: apps/rebar/src/rebar_app_utils.erl
lint_app_info/1,
format_error/1]).
+-ifdef(TEST).
+-export([validate_dep_name/2]).
+-endif.
+
-include("rebar.hrl").
-include_lib("providers/include/providers.hrl").
// Source: https://github.com/erlang/rebar3/commit/e35282b26e499b1d9e8f30bba9dccd71cd8b02ba
// The fix introduces validate_dep_name/2 to reject dependency names that aren't plain directory names.
Detection Methods for CVE-2026-103060
Indicators of Compromise
- Files or directories appearing outside the project's _build directory immediately after a rebar3 get-deps, rebar3 upgrade, or rebar3 compile run
- Unexpected deletion of directories adjacent to or above the project root on developer or CI hosts
- Hex package lock entries (rebar.lock) referencing dependencies whose app name contains .., /, or absolute path components
Detection Strategies
- Audit rebar.lock and resolved dependency manifests for app values that are not plain directory names using a regex such as ^[A-Za-z0-9_]+$
- Run rebar3 get-deps inside an ephemeral sandbox or container and compare the pre- and post-run filesystem tree for writes outside _build
- Enable filesystem auditing (auditd, EDR file-write telemetry) on build agents for rm -rf and extraction activity initiated by the rebar3/escript process tree
Monitoring Recommendations
- Alert on child processes of rebar3 or escript performing filesystem writes outside the current working directory
- Monitor CI job logs for dependency names containing .. or path separators during the fetch phase
- Track rebar3 version inventory across developer workstations and build infrastructure to flag hosts still running versions below 3.27.2
How to Mitigate CVE-2026-103060
Immediate Actions Required
- Upgrade rebar3 to version 3.27.2 or later on all developer workstations, CI runners, and release pipelines
- Re-resolve dependencies in a clean workspace and review rebar.lock for any entries introduced from untrusted sources
- Rotate any secrets or signing keys that were accessible from build environments if suspicious dependency fetches are observed in historical logs
Patch Information
The fix is delivered in rebar33.27.2. The commit e35282b adds validate_dep_name/2 to rebar_app_utils, rejecting any dependency name that is not a plain directory component. Supporting changes land in commit 56b7d88. The Hex registry side was hardened on 2026-10-12 to reject non-directory values in the app field. Full technical context is published in the GitHub Security Advisory GHSA-6ggr-r7mh-2mv8 and the Erlang Ecosystem Foundation CNA advisory.
Workarounds
- Run rebar3 get-deps only inside containers or unprivileged sandbox accounts whose writable paths are limited to the project directory
- Pin dependencies to known-good versions in rebar.lock and refuse to upgrade until the toolchain is patched
- Pre-scan dependency metadata and reject any release whose app field is not a plain directory name before invoking rebar3
# Upgrade rebar3 and verify the installed version is 3.27.2 or later
./bootstrap # when building from source at tag 3.27.2
rebar3 local upgrade # for the escript-managed install
rebar3 --version # expected: rebar 3.27.2 or newer
# Fail a CI job if any resolved dependency name contains path traversal
awk -F'"' '/\{pkg,/ { if ($2 ~ /\.\.|\//) { print "unsafe dep:" $2; exit 1 } }' rebar.lock
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

