# CVE-2026-42795: Symlink Following in Hex Package Export Allows Embedding Files Outside Project Root

- Severity: Medium 5.1 (CVSS:4.0, scored by EEF) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-02T13:41:39.527Z
- Modified: 2026-11-25T06:30:22.898Z
- Also known as: EEF-CVE-2026-42795, GHSA-qhh5-fg4c-8gqc
- Weaknesses: CWE-59
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: EEF

## 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.

(As written by CVE List.)

## Affected

- gleam-lang/gleam: from v0.10.0-rc1-elixir before v1.17.0-elixir; from v0.10.0-rc1-erlang before v1.17.0-erlang; from v0.10.0-rc1-node before v1.17.0-node; from v0.10.0-rc1-node-slim before v1.17.0-node-slim; from v0.10.0-rc1-elixir-slim before v1.17.0-elixir-slim; from v0.10.0-rc1-erlang-slim before v1.17.0-erlang-slim; from v0.10.0-rc1-erlang-alpine before v1.17.0-erlang-alpine; from v0.10.0-rc1-elixir-alpine before v1.17.0-elixir-alpine; from v0.10.0-rc1-node-alpine before v1.17.0-node-alpine; from v0.10.0-rc1-scratch before v1.17.0-scratch; from c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c before 6435a5528b9ae0449e2f32be579641ec485f6866
- gleam: from 0.10.0-rc1 before 1.17.0
- https://github.com/gleam-lang/gleam: from c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c before 6435a5528b9ae0449e2f32be579641ec485f6866

## Every score

- EEF: CVSS:4.0 5.1 Medium `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`
- Erlang Ecosystem Foundation: CVSS:4.0 `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`

## References

- <https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc> (exploit, advisory, related, vendor-advisory)
- <https://cna.erlef.org/cves/CVE-2026-42795.html> (related, web)
- <https://osv.dev/vulnerability/EEF-CVE-2026-42795> (related)
- <https://github.com/gleam-lang/gleam/commit/c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c> (related, web)
- <https://github.com/gleam-lang/gleam/commit/6435a5528b9ae0449e2f32be579641ec485f6866> (fix, patch)

## Sources

- CVE List: [CVE-2026-42795](https://www.cve.org/CVERecord?id=CVE-2026-42795), CVE Terms of Use, modified 2026-11-20
- Erlang Ecosystem Foundation: [EEF-CVE-2026-42795](https://osv.dev/vulnerability/EEF-CVE-2026-42795), CC-BY-4.0, modified 2026-11-25
- NVD: [CVE-2026-42795](https://nvd.nist.gov/vuln/detail/CVE-2026-42795), Public domain, modified 2026-11-20

---

Page: https://cve.day/CVE-2026-42795 · Whole record: https://cve.day/CVE-2026-42795.json · Rebuilt by cve.day 2026-11-25T22:59:23.563Z
