CVE-2026-42795
Medium 5.1No known exploitationFix availableSymlink Following in Hex Package Export Allows Embedding Files Outside Project Root
Record last updated
CVSS score
Medium on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 10% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
Description
Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball. The 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. An 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. This issue affects gleam: from 0.10.0-rc1 before 1.17.0.
Weakness: CWE-59
Patching and mitigation
- Patch status
- Fix available (source: CVE record (EEF))
- Fix documented (source date)
- Mitigation
- * Avoid running gleam publish or gleam export hex-tarball on untrusted projects * Review the contents of src/ and priv/ for unexpected symlinks before publishing * Run publishing commands in a restricted or isolated environment (e.g. containers) Source (opens in a new tab)
- Vendor guidance
- github.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Gleam | Gleam | from 0.10.0-rc1 before 1.17.0 | 1.17.0 | CVE Program |
| Gleam | Gleam | from c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c before 6435a5528b9ae0449e2f32be579641ec485f6866 | 6435a5528b9ae0449e2f32be579641ec485f6866 | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-elixir before v1.17.0-elixir | v1.17.0-elixir | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-elixir-alpine before v1.17.0-elixir-alpine | v1.17.0-elixir-alpine | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-elixir-slim before v1.17.0-elixir-slim | v1.17.0-elixir-slim | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-erlang before v1.17.0-erlang | v1.17.0-erlang | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-erlang-alpine before v1.17.0-erlang-alpine | v1.17.0-erlang-alpine | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-erlang-slim before v1.17.0-erlang-slim | v1.17.0-erlang-slim | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-node before v1.17.0-node | v1.17.0-node | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-node-alpine before v1.17.0-node-alpine | v1.17.0-node-alpine | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-node-slim before v1.17.0-node-slim | v1.17.0-node-slim | CVE Program |
| Gleam | Gleam | from v0.10.0-rc1-scratch before v1.17.0-scratch | v1.17.0-scratch | CVE Program |
Timeline
Disclosure
CVE record published by EEF
Source: CVE Program (opens in a new tab)
Patch
Fix documented by CVE record (EEF)
Vendor guidance and references
- Fix commit 6435a55 in gleam-lang/gleam (opens in a new tab)patch
- Symlink dereference during Hex package export can leak files outside the project root (opens in a new tab)related, vendor-advisory
- EEF CNA record for CVE-2026-42795 (opens in a new tab)related
- Introducing commit c82a2d8 in gleam-lang/gleam (opens in a new tab)related
- OSV record EEF-CVE-2026-42795 (opens in a new tab)related