Skip to main content

Gleam EUVDEUVD-2026-33928

| CVE-2026-42795 MEDIUM
Improper Link Resolution Before File Access (CWE-59)
2026-06-02 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
5.1
CVSS 4.0 · NVD
Share

Severity by source

NVD PRIMARY
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/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
SUSE
MEDIUM
qualitative

Primary rating from NVD.

CVSS VectorNVD

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
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
A
Scope
X

Lifecycle Timeline

3
Patch available
Jun 02, 2026 - 16:01 EUVD
Source Code Evidence Fetched
Jun 02, 2026 - 14:39 vuln.today
Analysis Generated
Jun 02, 2026 - 14:39 vuln.today

DescriptionCVE.org

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.

AnalysisAI

Symlink following in Gleam's Hex package export pipeline silently embeds arbitrary local files into published package artifacts, enabling credential exfiltration via supply chain. Affected versions span 0.10.0-rc1 through the 1.16.x line, with the fix landing in 1.17.0. An authenticated attacker with write access to a Gleam repository can plant a symlink in a tracked publishable directory (src/, priv/), causing a maintainer's sensitive local files - SSH keys, API tokens, CI secrets - to be bundled into the publicly distributed Hex tarball without any warning. No public exploit identified and no CISA KEV listing at time of analysis, but the attack is trivially repeatable using standard shell tooling.

Technical ContextAI

The root cause is CWE-59 (Improper Link Resolution Before File Access - Link Following). In compiler-cli/src/fs.rs, the file collection helpers gleam_files, native_files, and private_files invoke the directory walker with follow_links(true), which causes symlinks to be resolved transparently during directory traversal. The resulting resolved paths were then passed to add_path_to_tar in compiler-cli/src/publish.rs, which called the tar crate's append_path() without first verifying that the canonicalized target remained within the project root boundary. The fix in commit 6435a5528b9ae0449e2f32be579641ec485f6866 introduces a strict path containment check via strip_prefix(paths.root()) in the renamed add_to_tar_from_file_system function, rejecting any path whose resolved form escapes the project root. The fix also separates in-memory data handling (add_to_tar_from_memory) from filesystem-sourced data (add_to_tar_from_file_system) to make the two trust boundaries explicit in code structure.

RemediationAI

Upgrade to Gleam 1.17.0 or later, which contains the upstream fix from commit 6435a5528b9ae0449e2f32be579641ec485f6866 adding path containment enforcement in the Hex tarball generation pipeline. Until upgrade is feasible, audit all publishable directories before each publish run using find src/ priv/ -type l to enumerate symlinks; any symlink present should be treated as suspicious and investigated before proceeding. A CI pre-publish gate that fails the pipeline on detection of any symlink in src/ or priv/ (e.g., a shell step asserting that find src/ priv/ -type l produces no output) provides a practical compensating control with negligible operational overhead. Note that this workaround is procedural and bypassable if the CI environment itself is compromised. Do not rely solely on code review to catch symlink-based attacks, as symlinks can be visually inconspicuous in diff output. See https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc and https://cna.erlef.org/cves/CVE-2026-42795.html for vendor guidance.

Vendor StatusVendor

SUSE

Severity: Medium

Share

EUVD-2026-33928 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy