Skip to content
Threat Brief

← All advisories

CVE-2026-42795

Medium 5.1No known exploitationFix available

Symlink Following in Hex Package Export Allows Embedding Files Outside Project Root

Record last updated

CVSS score

5.1

Medium on a 0 to 10 scale

EPSS, chance of exploitation in 30 days

0.2%

Higher than 10% of scored CVEs. A prediction, not evidence.

CISA remediation deadline

None

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

VendorProductAffected versionsFixed inPer
GleamGleamfrom 0.10.0-rc1 before 1.17.01.17.0CVE Program
GleamGleamfrom c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c before 6435a5528b9ae0449e2f32be579641ec485f68666435a5528b9ae0449e2f32be579641ec485f6866CVE Program
GleamGleamfrom v0.10.0-rc1-elixir before v1.17.0-elixirv1.17.0-elixirCVE Program
GleamGleamfrom v0.10.0-rc1-elixir-alpine before v1.17.0-elixir-alpinev1.17.0-elixir-alpineCVE Program
GleamGleamfrom v0.10.0-rc1-elixir-slim before v1.17.0-elixir-slimv1.17.0-elixir-slimCVE Program
GleamGleamfrom v0.10.0-rc1-erlang before v1.17.0-erlangv1.17.0-erlangCVE Program
GleamGleamfrom v0.10.0-rc1-erlang-alpine before v1.17.0-erlang-alpinev1.17.0-erlang-alpineCVE Program
GleamGleamfrom v0.10.0-rc1-erlang-slim before v1.17.0-erlang-slimv1.17.0-erlang-slimCVE Program
GleamGleamfrom v0.10.0-rc1-node before v1.17.0-nodev1.17.0-nodeCVE Program
GleamGleamfrom v0.10.0-rc1-node-alpine before v1.17.0-node-alpinev1.17.0-node-alpineCVE Program
GleamGleamfrom v0.10.0-rc1-node-slim before v1.17.0-node-slimv1.17.0-node-slimCVE Program
GleamGleamfrom v0.10.0-rc1-scratch before v1.17.0-scratchv1.17.0-scratchCVE Program

Timeline

  1. Disclosure

    CVE record published by EEF

    Source: CVE Program (opens in a new tab)

  2. Patch

    Fix documented by CVE record (EEF)

    Source: CVE record (EEF) (opens in a new tab)

Vendor guidance and references