Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious Hex release with traversal app field
-
DeliveryVictim adds package as direct/transitive dependency
-
ExploitGleam downloads metadata and derives build dir name unvalidated
-
ExecutionDependency fails to compile during build
-
Impactremove_dir_all deletes attacker-chosen directory outside build dir
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a chain of specific prerequisites: (1) a malicious Hex package publisher who sets the release metadata app (OTP application name) field to a path-traversal or absolute path value - only possible for releases published to hex.pm before its 2026-10-12 server-side restriction; (2) the victim must depend on that release directly or transitively; and (3) the release must FAIL to compile, since deletion occurs only in Gleam's dependency-failure cleanup path (remove_dir_all on build_directory_for_package). It is further limited by required user interaction - a developer must actively invoke gleam build, check, run, test, or export - and by the affected version window (0.32.4 up to but not including 1.19.2). Impact is bounded to directory deletion (availability); no attacker code executes for a pure Gleam package. |
| Impact | This is a genuine but moderate-priority supply-chain integrity issue, not a critical remote-code-execution flaw. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:A) scores 5.9 (medium): network-reachable because the malicious metadata arrives via the hex.pm API, requiring no privileges on the victim, but gated by two real constraints - an Attack Requirement (AT:P) and active user interaction (UI:A, the developer must actually run a build). Crucially, impact is availability-only (VC:N/VI:N/VA:H): the bug deletes a directory via remove_dir_all but runs no publisher code for a pure Gleam package, so there is no confidentiality or code-execution impact. No EPSS score, KEV listing, or POC was provided in the input, so exploitation signals are weak: no public exploit identified at time of analysis and no evidence of active exploitation. A mitigating real-world factor not reflected in the base score is that hex.pm restricted the offending app field server-side before 2026-10-12, which closes the primary delivery path for newly published malicious releases even on unpatched Gleam clients. Net: a legitimate flaw worth patching to 1.19.2, but the destructive-yet-non-executing nature, the dependency-on-a-failing-malicious-package precondition, and the upstream hex.pm fix place it well below high-urgency items. |
| Exploit ScenarioDerived | A malicious actor publishes a Hex package whose release metadata sets the OTP app field to a path-traversal value such as ../../../../target or an absolute path, and induces a victim to add it as a direct or transitive dependency. When the developer runs gleam build/check/run/test/export and that dependency fails to compile, Gleam deletes the directory the traversal resolves to instead of just the package's build cache. No public exploit code was identified in the provided data, and for a pure Gleam package no attacker code executes - the damage is limited to directory deletion. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 12, 2026
The Gleam build tool (versions 0.32.4 up to but not including 1.19.2) derives the on-disk build directory for each dependency from the Hex release metadata 'app' (OTP application name) field without validating it, so a malicious package publisher could set that field to a traversal or absolute path such as ../../../../target and cause Gleam to delete an arbitrary directory outside the project build tree. The deletion happens only in the dependency-failure cleanup path: when a dependency fails to compile, Gleam calls remove_dir_all on the resolved build directory, meaning the attacker-controlled package must fail to build and the developer must actively run gleam build, check, run, test, or export (CVSS 4.0 5.9; assessed CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H). Impact is limited to availability (data/directory loss) - no attacker code runs, even for what appears to be a pure Gleam package - and there is no public exploit identified at time of analysis; the vendor has released fixes.
RemediationAI
Upgrade to Gleam 1.19.2 or later, which derives build directory names through the validated application_name()/package_name_overrides logic and no longer trusts the raw Hex 'app' field; the vendor has released this patch and the fix is visible in upstream commits d13f27ee80aae7a521d2e9433c4deaf53f892574, d15c981fac6e533d70ac8ee89a6ef4dbf139adc3, and 54bbb2b98af1505b6eed93c45b1936fc76412e5c (advisory: https://github.com/gleam-lang/gleam/security/advisories/GHSA-jhcr-c7qm-8589). If upgrading is not immediately possible, compensating controls are: restrict dependencies to a vetted, locked set (commit hex.lock / hex.toml and vendor dependencies locally) so no newly fetched release can introduce a crafted 'app' value - the trade-off is losing automatic dependency freshness; build within an isolated container or CI sandbox whose working directory contains no writable directories outside the project tree, so a traversal delete cannot reach valuable data (adds infrastructure overhead); avoid running gleam build/check/run/test/export against untrusted or newly published dependencies until they have been reviewed, since the delete only triggers when a dependency fails to compile; and keep automated backups of the build host to recover from any unexpected directory removal. Note that hex.pm's 2026-10-12 server-side restriction prevents new malicious 'app' values but does not retroactively clean releases published before that date, so old, unpinned dependency versions remain a residual risk.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), specifically an unvalidated trust boundary between external package registry metadata and local filesystem operations. Hex.pm's release API exposes an 'app' field describing the release's OTP application name; Gleam reads this field when downloading dependencies and stores it via hex_manifest_package in compiler-cli/src/dependencies.rs, then feeds it into ProjectPaths::build_directory_for_package, which simply joins it onto the build path. Before hex.pm added a server-side restriction on 2026-10-12, a publisher could supply values containing '../' sequences or absolute paths, so the computed build directory escaped the project's build tree. When a dependency later fails to compile, Gleam's cleanup logic calls remove_dir_all on that path, turning a path-resolution bug into arbitrary directory deletion. The upstream fix (commits d13f27ee80aae7a521d2e9433c4deaf53f892574, d15c981fac6e533d70ac8ee89a6ef4dbf139adc3, 54bbb2b98af1505b6eed93c45b1936fc76412e5c) introduces a package_name_overrides map and an application_name() accessor so the build directory key is derived from a validated package identity rather than raw registry metadata. Affected CPE: cpe:2.3:a:gleam:gleam:*:*:*:*:*:*:*:* (version window 0.32.4 to <1.19.2).
Know when Gleam gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Malicious metadata is network-delivered (AV:N) but needs a failing dependency and victim build action, so AC:H and UI:R; no victim privileges (PR:N); deletion yields availability-only impact (A:H, C/I:N).
Primary rating from Vendor (EEF).
CVSS VectorVendor: EEF
DescriptionCVE.org
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in gleam-lang gleam allows a malicious package publisher to delete a directory outside the project's build directory when a developer builds a project.
A Hex package release's metadata carries an app field with the release's OTP application name. Gleam reads this field from the hex.pm release API when it downloads dependencies and uses it as the package's build directory name without validating it (hex_manifest_package in compiler-cli/src/dependencies.rs, ProjectPaths::build_directory_for_package). When a dependency fails to compile, Gleam deletes that directory with remove_dir_all. hex.pm didn't restrict the field to a directory name before 2026-10-12, so a publisher could set it to a value such as ../../../../target or an absolute path. When a project depends on such a release directly or transitively and the release fails to compile, gleam build, gleam check, gleam run, gleam test or gleam export deletes the directory the name resolves to. For a pure Gleam package no publisher code runs.
This issue affects gleam: from 0.32.4 before 1.19.2.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Path traversal in Gleam compiler versions 1.9.0-rc1 through 1.15.3 and 1.16.0-rc1 allows arbitrary file system modificat
Package integrity bypass in the Gleam build tool (compiler-cli) versions 0.18.0 up to 1.18.0 lets an adversary-in-the-mi
EUVD-2026-97758
NVD
CVE.org
EPSS
GitHub
Exploit-DB