{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-42795","id":"CVE-2026-42795","title":"Symlink Following in Hex Package Export Allows Embedding Files Outside Project Root","description":"Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball.\n\nThe file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_","descriptionLong":"Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball.\n\nThe file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_tar in compiler-cli/src/publish.rs without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause gleam export hex-tarball or gleam publish to embed the contents of the symlink target into the generated Hex package.\n\nAn attacker with write access to the project repository can place a symlink in src/ or priv/ pointing to an arbitrary file. When a maintainer or CI pipeline runs gleam publish or gleam export hex-tarball, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact.\n\nThis issue affects gleam: from 0.10.0-rc1 before 1.17.0.","published":"2026-06-02T13:41:39.527Z","updated":"2026-11-20T06:17:27.530Z","reserved":"2026-04-29T18:06:33.251Z","status":"Deferred","rejected":false,"assigner":"EEF","metric":{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"medium","source":"EEF"},"metrics":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"medium","source":"EEF"},{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"medium","source":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db"},{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"unrated","source":"OSV"}],"rating":"medium","products":["Gleam"],"affectedProducts":[{"vendor":"Gleam","product":"Gleam","defaultStatus":"unaffected","versions":[{"lessThan":"v1.17.0-elixir","status":"affected","version":"v0.10.0-rc1-elixir","versionType":"other"},{"lessThan":"v1.17.0-erlang","status":"affected","version":"v0.10.0-rc1-erlang","versionType":"other"},{"lessThan":"v1.17.0-node","status":"affected","version":"v0.10.0-rc1-node","versionType":"other"},{"lessThan":"v1.17.0-node-slim","status":"affected","version":"v0.10.0-rc1-node-slim","versionType":"other"},{"lessThan":"v1.17.0-elixir-slim","status":"affected","version":"v0.10.0-rc1-elixir-slim","versionType":"other"},{"lessThan":"v1.17.0-erlang-slim","status":"affected","version":"v0.10.0-rc1-erlang-slim","versionType":"other"},{"lessThan":"v1.17.0-erlang-alpine","status":"affected","version":"v0.10.0-rc1-erlang-alpine","versionType":"other"},{"lessThan":"v1.17.0-elixir-alpine","status":"affected","version":"v0.10.0-rc1-elixir-alpine","versionType":"other"},{"lessThan":"v1.17.0-node-alpine","status":"affected","version":"v0.10.0-rc1-node-alpine","versionType":"other"},{"lessThan":"v1.17.0-scratch","status":"affected","version":"v0.10.0-rc1-scratch","versionType":"other"}],"platforms":[]},{"vendor":"Gleam","product":"Gleam","defaultStatus":"unaffected","versions":[{"lessThan":"1.17.0","status":"affected","version":"0.10.0-rc1","versionType":"semver"}],"platforms":[]},{"vendor":"Gleam","product":"Gleam","defaultStatus":"unaffected","versions":[{"lessThan":"6435a5528b9ae0449e2f32be579641ec485f6866","status":"affected","version":"c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c","versionType":"git"}],"platforms":[]}],"packages":[],"cwes":["CWE-59"],"aliases":["EEF-CVE-2026-42795","GHSA-qhh5-fg4c-8gqc"],"references":[{"url":"https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc","tags":["vendor-advisory","related","exploit","advisory"]},{"url":"https://cna.erlef.org/cves/CVE-2026-42795.html","tags":["related","web"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-42795","tags":["related","web"]},{"url":"https://github.com/gleam-lang/gleam/commit/c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c","tags":["related","fix"]},{"url":"https://github.com/gleam-lang/gleam/commit/6435a5528b9ae0449e2f32be579641ec485f6866","tags":["patch","fix"]},{"url":"https://ghcr.io","tags":["web"]},{"url":"https://github.com","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42795.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42795","tags":["advisory"]},{"url":"https://github.com/gleam-lang/gleam","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00199,"epssPercentile":0.09855,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-42795","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42795","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-42795","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-42795","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}