Description
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.
Published: 2026-06-02
Score: 5.6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a Path Traversal flaw (CWE‑22) in Gleam’s dependency resolver. When a malicious build/packages/packages.toml file is processed, the keys are concatenated with the build directory and passed directly to a file delete routine. Because no bounds check is performed, an attacker can specify keys that reference absolute paths or include traversal sequences, causing the program to delete any directory the user process can reach. The primary impact is the accidental or intentional removal of arbitrary directories, potentially disrupting application data, configuration, or the host filesystem.

Affected Systems

GLEAM, the functional language runtime, is affected in all releases from 0.18.0‑rc1 up to and including 1.17.0. Users running these versions on any operating system and executing "gleam deps download" on a project that contains a malicious build/packages/packages.toml are at risk. No other products or vendor versions are explicitly listed as vulnerable in the current CNA data.

Risk and Exploitability

The CVSS score is 5.6, indicating a moderate severity. Exploitation requires a local or delegated user who is able to trigger a dependency download; an attacker can supply a malicious repository that the victim will clone and run. The EPSS score is not available, so current exploitation likelihood is unclear, but the missing protection makes it feasible for a determined attacker. The vulnerability is not listed in CISA’s KEV catalog, but its impact on file integrity and availability makes it a priority for remediation.

Generated by OpenCVE AI on June 2, 2026 at 15:37 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Gleam to version 1.18.0 or later, where the dependency resolver validates package keys before deletion.
  • Avoid using untrusted build/packages/packages.toml files; ensure that any repository you incorporate is reviewed for malicious keys.
  • If an upgrade is not immediately possible, implement a policy that rejects any package key containing ".." or absolute paths, or perform a pre-deletion sanity check to restrict deletions to the intended build/packages/ directory.

Generated by OpenCVE AI on June 2, 2026 at 15:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 02 Jun 2026 16:00:00 +0000

Type Values Removed Values Added
First Time appeared Gleam
Gleam gleam
Vendors & Products Gleam
Gleam gleam

Tue, 02 Jun 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 02 Jun 2026 14:15:00 +0000

Type Values Removed Values Added
Description 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.
Title Path Traversal in build/packages/packages.toml Allows Arbitrary Directory Deletion
First Time appeared Gleam-lang
Gleam-lang gleam
Weaknesses CWE-22
CPEs cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*
Vendors & Products Gleam-lang
Gleam-lang gleam
References
Metrics cvssV4_0

{'score': 5.6, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-06-02T19:14:19.113Z

Reserved: 2026-05-04T18:23:25.573Z

Link: CVE-2026-43965

cve-icon Vulnrichment

Updated: 2026-06-02T15:07:19.180Z

cve-icon NVD

Status : Deferred

Published: 2026-06-02T14:16:54.053

Modified: 2026-06-02T16:16:40.897

Link: CVE-2026-43965

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-02T15:45:06Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')