Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker gains repository write access
-
DeliveryCommit malicious packages.toml with traversal key
-
ExploitVictim clones or pulls repository
-
ExecutionVictim executes gleam deps download
-
PersistTraversal key deserialized without validation
-
Impactremove_dir_all recursively deletes target directory
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 three concurrent conditions to be satisfied. First, the attacker must be able to plant a malicious build/packages/packages.toml containing path traversal sequences as package keys - this file is normally excluded by .gitignore, so the attacker needs either repository write access (e.g., as a contributor, maintainer, or via a compromised account) or control over a mechanism that writes to the build/ directory before the victim runs dependency commands. Second, the victim must be running a vulnerable Gleam version (0.18.0-rc1 through 1.16.x). Third, the victim must actively execute 'gleam deps download' or an equivalent command that triggers LocalPackages::read_from_disc - this is required user interaction (UI:A in the CVSS vector) and means passive infection is not possible. Exploitation is confined to the local filesystem of the machine running the CLI (AV:L); there is no direct remote or network-based attack path. The impact is strictly destructive: directories are deleted but no data is exfiltrated and no code is executed (VC:N/VI:N/VA:H per CVSS vector). Exploitation is limited to Gleam versions before 1.17.0 and is not possible on patched releases due to the enforced package name allowlist. |
| Impact | The CVSS 4.0 score of 5.6 (Medium) accurately reflects the constrained attack surface. AV:L indicates the exploit executes within the local filesystem context - there is no network-reachable attack path. AT:P signals that specific preconditions must be satisfied: the attacker must have already introduced the malicious packages.toml into the project's build directory, a file normally absent from version control. UI:A confirms the victim must actively invoke 'gleam deps download', limiting opportunistic exploitation. The impact is purely destructive availability (VA:H) with no confidentiality or integrity compromise on either the vulnerable or subsequent systems (VC:N/VI:N/SC:N/SI:N/SA:N per the CVSS vector). No EPSS score was provided in the input data, so probabilistic exploitation likelihood cannot be quantified. The absence of a CISA KEV listing and the lack of any identified public exploit code at time of analysis further support classification as a medium-priority issue. Real-world risk is highest in CI/CD pipelines that automatically execute 'gleam deps download' on untrusted or externally-contributed repositories, since those environments may process attacker-controlled files without human review. The CVSS vector and the vulnerability description are fully consistent - no conflicting signals were detected. |
| Exploit ScenarioDerived | An attacker with write access to a shared Gleam project repository - such as a malicious open-source contributor or a compromised maintainer account - commits a crafted build/packages/packages.toml containing a package key such as '../../../../home/developer/.ssh' to the normally gitignored build/ directory. When a developer or automated CI agent clones the repository and runs 'gleam deps download', Gleam reads the traversal key without validation, constructs the out-of-bounds path, and passes it to remove_dir_all, silently and recursively deleting the targeted directory. No public exploit code has been identified at time of analysis, but the attack requires no specialized tooling beyond repository write access and knowledge of the target directory structure. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 02, 2026
Arbitrary recursive directory deletion in Gleam's dependency management (versions 0.18.0-rc1 through 1.16.x) is triggered when a developer runs 'gleam deps download' against a project whose normally-gitignored build/packages/packages.toml has been seeded with path traversal sequences as package keys. The compiler-cli reads these keys without validation, constructs a filesystem path via paths.build_packages_package(), and passes it directly to fs::delete_directory (Rust's remove_dir_all), allowing sequences such as '../../' or absolute paths to escape the intended build/packages/ directory and destroy arbitrary directories on the victim's machine. No public exploit has been identified at time of analysis and this vulnerability is not listed in the CISA KEV catalog; the fix commit and GitHub Security Advisory GHSA-jqvf-f6p2-wrv3 confirm the issue and its resolution.
RemediationAI
Upgrade Gleam to version 1.17.0, the first patched release as inferred from the 'until 1.17.0' version boundary stated in the NVD description and confirmed by the fix committed at https://github.com/gleam-lang/gleam/commit/690ca069817bee5f77a28fc3e360627c1da19291. The patch enforces package name validation at the Serde deserialization boundary, rejecting keys that contain path separators or characters outside [a-z0-9_]. If an immediate upgrade is not feasible, a practical compensating control is to inspect the build/packages/packages.toml file for any keys containing '/', '\', or '..' sequences before running dependency commands; this file should not ordinarily exist in version control, so its committed presence is itself a high-fidelity indicator of malicious intent. For CI/CD pipelines that process untrusted Gleam repositories, constrain the pipeline's working directory using filesystem sandboxing (e.g., containers with a restricted mount namespace) so that any traversal attempt can only affect ephemeral build volumes rather than persistent infrastructure or developer home directories. Full advisory: https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3.
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
Gleam is a statically-typed functional language targeting the BEAM VM and JavaScript runtimes; its CLI manages dependency state via an internal build/packages/packages.toml file that is normally excluded by .gitignore. The vulnerability (CWE-22: Path Traversal) is located in the LocalPackages::read_from_disc function within compiler-cli/src/dependencies.rs. Package name keys deserialized from the TOML map are passed directly to paths.build_packages_package(), which joins the project's build directory with the caller-supplied key to produce a filesystem path; that path is then handed to fs::delete_directory, a wrapper around Rust's std::fs::remove_dir_all. Because remove_dir_all applies no containment check, both absolute paths and relative traversal sequences are silently accepted. The root cause is the complete absence of an input validation layer at the Serde deserialization boundary for map keys. The fix at commit 690ca069817bee5f77a28fc3e360627c1da19291 introduces a custom deserializer (map_with_package_name_keys::deserialize) that rejects any key not matching the pattern [a-z0-9_]+, as confirmed by the added snapshot test which records rejection of '../../stuff' with the error 'expected a package name containing only lowercase letter, numbers, and underscores'. The same deserializer was also applied to the dependencies and dev_dependencies maps in PackageConfig and Manifest, hardening the broader config-parsing surface.
Know when the next one hits your stack
- 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:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Primary rating from Vendor (6b3ad84c-e1a6-4bf7-a703-f496b71e49db).
CVSS VectorVendor: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Lifecycle Timeline
1DescriptionCVE.org
Path traversal vulnerability in Gleam's dependency management allows arbitrary directory deletion via malicious build/packages/packages.toml content.
Package keys read from build/packages/packages.toml by LocalPackages::read_from_disc are passed without validation to paths.build_packages_package(), which constructs a filesystem path by joining the project build directory with the attacker-controlled key. The resulting path is then passed to fs::delete_directory (which calls remove_dir_all). No check is performed to ensure the path remains within the intended build/packages/ directory. Both absolute paths and relative traversal sequences (e.g. ../) are accepted as package keys, allowing deletion of arbitrary directories.
An attacker who can cause a victim to run gleam deps download on a project containing a malicious build/packages/packages.toml (e.g. by committing the normally-gitignored file to a repository) can cause arbitrary directories on the victim's system to be recursively deleted.
This issue affects Gleam from 0.18.0-rc1 until 1.17.0.
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.
EUVD-2026-33926
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB