CVE-2026-42795 Details
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 until 1.17.0.
A symlink following vulnerability has been identified in Gleam's Hex package export feature. This vulnerability allows files located outside the project root to be embedded in the generated package tarball. The issue arises because the file collection helpers in the compiler CLI module follow symlinks when traversing publishable directories, such as 'src/' and 'priv/'. The collected paths are then added to the package archive without verifying that they remain within the project root. As a result, a symlink placed in a publishable directory can lead to the inclusion of arbitrary files in the Hex package. This vulnerability affects Gleam versions 0.10.0-rc1 prior to 1.17.0.
Users can update to Gleam version 1.17.0 or later, where this vulnerability has been patched. Additionally, reviewing the 'src/' and 'priv/' directories for unexpected symlinks before publishing can help mitigate this issue.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jun 2, 2026CISA-ADP
Assessed Jun 2, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://cna.erlef.org/cves/CVE-2026-42795.html | EEF | AdvisoryBundle |
| https://github.com/gleam-lang/gleam/commit/6435a5528b9ae0449e2f32be579641ec485f6866 | EEF | Source CodeVendor |
| https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc | EEF | AdvisoryExploitRemedyVendor |
| https://osv.dev/vulnerability/EEF-CVE-2026-42795 | EEF | AdvisoryBundle |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-59 | Improper Link Resolution Before File Access ('Link Following') | EEF |
Affected Products
| Product | Versions |
|---|---|
| Gleam | >= 0.10.0-rc1, < 1.17.0 (semver) |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 8, 2026 | CVE Modified | EEF |
| Sep 8, 2026 | CVE Modified | CISA-ADP |
| Jul 22, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | EEF |
| Jun 2, 2026 | CVE Modified | CISA-ADP |
| Jun 2, 2026 | New CVE Received | EEF |
Volerion