{"id":"CVE-2026-43965","summary":"Path Traversal in build/packages/packages.toml Allows Arbitrary Directory Deletion","details":"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 until 1.17.0.","aliases":["EEF-CVE-2026-43965","GHSA-jqvf-f6p2-wrv3"],"modified":"2026-07-24T03:56:43.247716185Z","published":"2026-06-02T13:41:37.421Z","related":["openSUSE-SU-2026:10953-1","openSUSE-SU-2026:21143-1"],"database_specific":{"cwe_ids":["CWE-22"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43965.json","unresolved_ranges":[{"extracted_events":[{"introduced":"ed7aec0484f10d60978b63788c8a6497590855ab"},{"fixed":"690ca069817bee5f77a28fc3e360627c1da19291"}],"source":"AFFECTED_FIELD"}],"cna_assigner":"EEF"},"references":[{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-43965.html"},{"type":"WEB","url":"https://ghcr.io"},{"type":"WEB","url":"https://github.com"},{"type":"WEB","url":"https://osv.dev/vulnerability/EEF-CVE-2026-43965"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43965.json"},{"type":"ADVISORY","url":"https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43965"},{"type":"FIX","url":"https://github.com/gleam-lang/gleam/commit/690ca069817bee5f77a28fc3e360627c1da19291"},{"type":"PACKAGE","url":"https://github.com/gleam-lang/gleam"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/gleam-lang/gleam","events":[{"introduced":"6b77fbe92b38b7d0a31fd824caaf66d0e1708be5"},{"fixed":"690ca069817bee5f77a28fc3e360627c1da19291"}],"database_specific":{"source":["AFFECTED_FIELD","REFERENCES"],"extracted_events":[{"introduced":"0.18.0-rc1"},{"fixed":"1.17.0"},{"introduced":"v0.18.0-rc1-elixir"},{"fixed":"v1.17.0-elixir"},{"introduced":"v0.18.0-rc1-erlang"},{"fixed":"v1.17.0-erlang"},{"introduced":"v0.18.0-rc1-node"},{"fixed":"v1.17.0-node"},{"introduced":"v0.18.0-rc1-node-slim"},{"fixed":"v1.17.0-node-slim"},{"introduced":"v0.18.0-rc1-elixir-slim"},{"fixed":"v1.17.0-elixir-slim"},{"introduced":"v0.18.0-rc1-erlang-slim"},{"fixed":"v1.17.0-erlang-slim"},{"introduced":"v0.18.0-rc1-erlang-alpine"},{"fixed":"v1.17.0-erlang-alpine"},{"introduced":"v0.18.0-rc1-elixir-alpine"},{"fixed":"v1.17.0-elixir-alpine"},{"introduced":"v0.18.0-rc1-node-alpine"},{"fixed":"v1.17.0-node-alpine"},{"introduced":"v0.18.0-rc1-scratch"},{"fixed":"v1.17.0-scratch"}]}}],"versions":["v1.17.0-rc2","v1.17.0-rc1","v1.16.0","v1.16.0-rc4","v1.16.0-rc3","v1.16.0-rc2","v1.16.0-rc1","v1.15.1","v1.15.0","v1.15.0-rc2","v1.15.0-rc1","v1.14.0","v1.14.0-rc3","v1.14.0-rc2","v1.14.0-rc1","v1.13.0","v1.13.0-rc2","v1.13.0-rc1","v1.12.0","v1.12.0-rc3","v1.12.0-rc2","v1.12.0-rc1","v1.11.1","v1.11.0","v1.11.0-rc2","v1.11.0-rc1","v1.10.0","v1.10.0-rc1","v1.9.1","v1.9.0","v1.9.0-rc2","v1.9.0-rc1","v1.8.0","v1.8.0-rc1","v1.7.0-rc3","v1.7.0-rc2","v1.7.0-rc1","v1.6.1","v1.6.0","v1.6.0-rc2","v1.6.0-rc1","v1.5.0","v1.5.0-rc2","v1.5.0-rc1","v1.4.1","v1.4.0","v1.4.0-rc1","v1.3.2","v1.3.1","v1.3.0","v1.3.0-rc3","v1.3.0-rc2","v1.3.0-rc1","v1.2.1","v1.2.0","v1.2.0-rc2","v1.2.0-rc1","v1.1.0","v1.1.0-rc3","v1.1.0-rc2","v1.1.0-rc1","v1.0.0","v1.0.0-rc2","v1.0.0-rc1","v0.34.1","v0.34.0","v0.34.0-rc2","v0.34.0-rc1","v0.33.0","v0.33.0-rc4","v0.33.0-rc3","v0.33.0-rc2","v0.33.0-rc1","v0.32.4","v0.32.3","v0.32.2","v0.32.1","v0.32.0","v0.32.0-rc3","v0.32.0-rc2","v0.32.0-rc1","v0.31.0","v0.31.0-rc1","v0.30.5","v0.30.4","v0.30.3","v0.30.2","v0.30.1","v0.30.0","v0.30.0-rc4","v0.30.0-rc3","v0.30.0-rc2","v0.30.0-rc1","v0.29.0","v0.29.0-rc2","v0.29.0-rc1","v0.28.3","v0.28.2","v0.28.1","v0.28.0","v0.28.0-rc3","v0.28.0-rc2","v0.28.0-rc1","v0.27.0","v0.27.0-rc1","v0.26.2","v0.26.1","v0.26.0","v0.26.0-rc1","v0.25.3","v0.25.2","v0.25.1","v0.25.0","v0.25.0-rc2","v0.25.0-rc1","v0.24.0","v0.24.0-rc4","v0.24.0-rc3","v0.24.0-rc2","v0.24.0-rc1","v0.23.0","v0.23.0-rc2","v0.23.0-rc1","v0.22.1","v0.22.0","v0.22.0-rc1","v0.21.0","v0.21.0-rc2","v0.21.0-rc1","nightly","v0.20.1","v0.20.0","v0.20.0-rc1","v0.19.0","v0.19.0-rc4","v0.19.0-rc3","v0.19.0-rc2","v0.19.0-rc1","v0.18.2","v0.18.1","v0.18.0","v0.18.0-rc3","v0.18.0-rc2","v0.18.0-rc1"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-43965.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"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"}]}