CVE-2026-43965 PUBLISHED

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

Assigner: EEF
Reserved: 04.05.2026 Published: 02.06.2026 Updated: 02.06.2026

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.

Metrics

CVSS 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
CVSS Score: 5.6

Product Status

Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from 0.18.0-rc1 to 1.17.0 (excl.)
Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from 0.18.0-rc1 to 1.17.0 (excl.)
  • affected from ed7aec0484f10d60978b63788c8a6497590855ab to 690ca069817bee5f77a28fc3e360627c1da19291 (excl.)
Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from v0.18.0-rc1-elixir to v1.17.0-elixir (excl.)
  • affected from v0.18.0-rc1-erlang to v1.17.0-erlang (excl.)
  • affected from v0.18.0-rc1-node to v1.17.0-node (excl.)
  • affected from v0.18.0-rc1-node-slim to v1.17.0-node-slim (excl.)
  • affected from v0.18.0-rc1-elixir-slim to v1.17.0-elixir-slim (excl.)
  • affected from v0.18.0-rc1-erlang-slim to v1.17.0-erlang-slim (excl.)
  • affected from v0.18.0-rc1-erlang-alpine to v1.17.0-erlang-alpine (excl.)
  • affected from v0.18.0-rc1-elixir-alpine to v1.17.0-elixir-alpine (excl.)
  • affected from v0.18.0-rc1-node-alpine to v1.17.0-node-alpine (excl.)
  • affected from v0.18.0-rc1-scratch to v1.17.0-scratch (excl.)

Credits

  • Aly (spect3r1) finder
  • Abdelrahman Ahmed Aboelkasem (0x2face) finder
  • Louis Pilfold remediation developer
  • Jonatan Männchen / EEF analyst

References

Problem Types

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') CWE

Impacts

  • CAPEC-139 Relative Path Traversal
  • CAPEC-597 Absolute Path Traversal