{"id":"CVE-2026-43965","published":"2026-06-02T13:41:37Z","modified":"2026-11-20T05:59:19Z","title":"Path Traversal in build/packages/packages.toml Allows Arbitrary Directory Deletion","vendor":"Gleam","product":"Gleam","tier":"tail","description":{"text":"Path traversal vulnerability in Gleam's dependency management allows arbitrary directory deletion via malicious build/packages/packages.toml content.\n\nPackage 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.\n\nAn 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.\n\nThis issue affects gleam: from 0.18.0-rc1 before 1.17.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.6,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00229,"percentile":0.13953,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-43965.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-43965","tags":["related"]},{"url":"https://github.com/gleam-lang/gleam/commit/ed7aec0484f10d60978b63788c8a6497590855ab","tags":["related"]},{"url":"https://github.com/gleam-lang/gleam/commit/690ca069817bee5f77a28fc3e360627c1da19291","tags":["patch"]}],"priority":{"score":6.7,"factors":[{"name":"EPSS percentile","points":2.79},{"name":"CVSS severity","points":3.92}]},"vendorSlug":"gleam","affectedVersions":[{"vendor":"Gleam","product":"Gleam","versions":[">= v0.18.0-rc1-elixir, < v1.17.0-elixir",">= v0.18.0-rc1-erlang, < v1.17.0-erlang",">= v0.18.0-rc1-node, < v1.17.0-node",">= v0.18.0-rc1-node-slim, < v1.17.0-node-slim",">= v0.18.0-rc1-elixir-slim, < v1.17.0-elixir-slim",">= v0.18.0-rc1-erlang-slim, < v1.17.0-erlang-slim",">= v0.18.0-rc1-erlang-alpine, < v1.17.0-erlang-alpine",">= v0.18.0-rc1-elixir-alpine, < v1.17.0-elixir-alpine",">= v0.18.0-rc1-node-alpine, < v1.17.0-node-alpine",">= v0.18.0-rc1-scratch, < v1.17.0-scratch"]},{"vendor":"Gleam","product":"Gleam","versions":[">= 0.18.0-rc1, < 1.17.0"]},{"vendor":"Gleam","product":"Gleam","versions":[">= ed7aec0484f10d60978b63788c8a6497590855ab, < 690ca069817bee5f77a28fc3e360627c1da19291"]}],"capec":[{"id":"CAPEC-139","name":"Relative Path Traversal"},{"id":"CAPEC-597","name":"Absolute Path Traversal"}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-06-02T15:07:44.667204Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-33926","exploited":false,"provenance":"source"}}