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::readfromdisc are passed without validation to paths.buildpackagespackage(), which constructs a filesystem path by joining the project build directory with the attacker-controlled key. The resulting path is then passed to fs::deletedirectory (which calls removedir_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.
{
"cwe_ids": [
"CWE-22"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43965.json",
"cna_assigner": "EEF",
"unresolved_ranges": [
{
"source": "AFFECTED_FIELD",
"extracted_events": [
{
"introduced": "ed7aec0484f10d60978b63788c8a6497590855ab"
},
{
"fixed": "690ca069817bee5f77a28fc3e360627c1da19291"
}
]
}
]
}{
"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"
}
]
}