Skip to main content
← All vulnerabilities
CVE-2026-43965

Path Traversal in build/packages/packages.toml Allows Arbitrary Directory Deletion

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.17.0, v1.17.0-elixir, v1.17.0-erlang, v1.17.0-node, v1.17.0-node-slim, and 6 more
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: partial

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: partial

  3. Record last updated

Affected versions

  • gleam

    From 0.18.0-rc1 · fixed in 1.17.0

  • gleam-lang/gleam

    From 0.18.0-rc1 · fixed in 1.17.0

  • gleam-lang/gleam

    From v0.18.0-rc1-elixir · fixed in v1.17.0-elixir; From v0.18.0-rc1-erlang · fixed in v1.17.0-erlang; From v0.18.0-rc1-node · fixed in v1.17.0-node; From v0.18.0-rc1-node-slim · fixed in v1.17.0-node-slim; From v0.18.0-rc1-elixir-slim · fixed in v1.17.0-elixir-slim; From v0.18.0-rc1-erlang-slim · fixed in v1.17.0-erlang-slim; From v0.18.0-rc1-erlang-alpine · fixed in v1.17.0-erlang-alpine; From v0.18.0-rc1-elixir-alpine · fixed in v1.17.0-elixir-alpine; From v0.18.0-rc1-node-alpine · fixed in v1.17.0-node-alpine; From v0.18.0-rc1-scratch · fixed in v1.17.0-scratch

References 4

GitHub · gleam-lang/gleam

cna.erlef.org

osv.dev