Skip to main content

Gleam CVE-2026-43965

| EUVDEUVD-2026-33926 MEDIUM
Path Traversal (CWE-22)
2026-06-02 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
5.6
CVSS 4.0 · Vendor: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker gains repository write access
  2. Delivery
    Commit malicious packages.toml with traversal key
  3. Exploit
    Victim clones or pulls repository
  4. Execution
    Victim executes gleam deps download
  5. Persist
    Traversal key deserialized without validation
  6. Impact
    remove_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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Gleam v0.18.0-rc1-node <v1.17.0-node
Gleam v0.18.0-rc1-erlang-slim <v1.17.0-erlang-slim
Gleam v0.18.0-rc1-scratch <v1.17.0-scratch
Gleam v0.18.0-rc1-elixir <v1.17.0-elixir
Gleam v0.18.0-rc1-erlang <v1.17.0-erlang
Gleam 0.18.0-rc1 <1.17.0
Gleam v0.18.0-rc1-elixir-alpine <v1.17.0-elixir-alpine
Gleam v0.18.0-rc1-elixir-slim <v1.17.0-elixir-slim
Gleam ed7aec0484f10d60978b63788c8a6497590855ab <690ca069817bee5f77a28fc3e360627c1da19291
Gleam v0.18.0-rc1-erlang-alpine <v1.17.0-erlang-alpine
Gleam v0.18.0-rc1-node-alpine <v1.17.0-node-alpine
Gleam v0.18.0-rc1-node-slim <v1.17.0-node-slim

Affected Packages

euvd gleam fix: 1.17.0

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

Vendor (6b3ad84c-e1a6-4bf7-a703-f496b71e49db) PRIMARY 5.6 MEDIUM
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
SUSE MEDIUM

Primary rating from Vendor (6b3ad84c-e1a6-4bf7-a703-f496b71e49db).

CVSS VectorVendor: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Jun 02, 2026 - 16:01 EUVD

DescriptionCVE.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

EPSS Score
0.0%
Top 97% exploitable
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Vendor StatusVendor

SUSE

Severity: Medium

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy