Skip to main content

Gleam CVE-2026-103061

| EUVDEUVD-2026-97758 MEDIUM
Path Traversal (CWE-22)
2026-10-12 EEF
5.9
CVSS 4.0 · Vendor: EEF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Publish malicious Hex release with traversal app field
  2. Delivery
    Victim adds package as direct/transitive dependency
  3. Exploit
    Gleam downloads metadata and derives build dir name unvalidated
  4. Execution
    Dependency fails to compile during build
  5. Impact
    remove_dir_all deletes attacker-chosen directory outside build dir

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a chain of specific prerequisites: (1) a malicious Hex package publisher who sets the release metadata app (OTP application name) field to a path-traversal or absolute path value - only possible for releases published to hex.pm before its 2026-10-12 server-side restriction; (2) the victim must depend on that release directly or transitively; and (3) the release must FAIL to compile, since deletion occurs only in Gleam's dependency-failure cleanup path (remove_dir_all on build_directory_for_package). It is further limited by required user interaction - a developer must actively invoke gleam build, check, run, test, or export - and by the affected version window (0.32.4 up to but not including 1.19.2). Impact is bounded to directory deletion (availability); no attacker code executes for a pure Gleam package.

Impact

This is a genuine but moderate-priority supply-chain integrity issue, not a critical remote-code-execution flaw. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:A) scores 5.9 (medium): network-reachable because the malicious metadata arrives via the hex.pm API, requiring no privileges on the victim, but gated by two real constraints - an Attack Requirement (AT:P) and active user interaction (UI:A, the developer must actually run a build). Crucially, impact is availability-only (VC:N/VI:N/VA:H): the bug deletes a directory via remove_dir_all but runs no publisher code for a pure Gleam package, so there is no confidentiality or code-execution impact. No EPSS score, KEV listing, or POC was provided in the input, so exploitation signals are weak: no public exploit identified at time of analysis and no evidence of active exploitation. A mitigating real-world factor not reflected in the base score is that hex.pm restricted the offending app field server-side before 2026-10-12, which closes the primary delivery path for newly published malicious releases even on unpatched Gleam clients. Net: a legitimate flaw worth patching to 1.19.2, but the destructive-yet-non-executing nature, the dependency-on-a-failing-malicious-package precondition, and the upstream hex.pm fix place it well below high-urgency items.

Exploit ScenarioDerived

A malicious actor publishes a Hex package whose release metadata sets the OTP app field to a path-traversal value such as ../../../../target or an absolute path, and induces a victim to add it as a direct or transitive dependency. When the developer runs gleam build/check/run/test/export and that dependency fails to compile, Gleam deletes the directory the traversal resolves to instead of just the package's build cache. No public exploit code was identified in the provided data, and for a pure Gleam package no attacker code executes - the damage is limited to directory deletion.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 12, 2026

The Gleam build tool (versions 0.32.4 up to but not including 1.19.2) derives the on-disk build directory for each dependency from the Hex release metadata 'app' (OTP application name) field without validating it, so a malicious package publisher could set that field to a traversal or absolute path such as ../../../../target and cause Gleam to delete an arbitrary directory outside the project build tree. The deletion happens only in the dependency-failure cleanup path: when a dependency fails to compile, Gleam calls remove_dir_all on the resolved build directory, meaning the attacker-controlled package must fail to build and the developer must actively run gleam build, check, run, test, or export (CVSS 4.0 5.9; assessed CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H). Impact is limited to availability (data/directory loss) - no attacker code runs, even for what appears to be a pure Gleam package - and there is no public exploit identified at time of analysis; the vendor has released fixes.

RemediationAI

Upgrade to Gleam 1.19.2 or later, which derives build directory names through the validated application_name()/package_name_overrides logic and no longer trusts the raw Hex 'app' field; the vendor has released this patch and the fix is visible in upstream commits d13f27ee80aae7a521d2e9433c4deaf53f892574, d15c981fac6e533d70ac8ee89a6ef4dbf139adc3, and 54bbb2b98af1505b6eed93c45b1936fc76412e5c (advisory: https://github.com/gleam-lang/gleam/security/advisories/GHSA-jhcr-c7qm-8589). If upgrading is not immediately possible, compensating controls are: restrict dependencies to a vetted, locked set (commit hex.lock / hex.toml and vendor dependencies locally) so no newly fetched release can introduce a crafted 'app' value - the trade-off is losing automatic dependency freshness; build within an isolated container or CI sandbox whose working directory contains no writable directories outside the project tree, so a traversal delete cannot reach valuable data (adds infrastructure overhead); avoid running gleam build/check/run/test/export against untrusted or newly published dependencies until they have been reviewed, since the delete only triggers when a dependency fails to compile; and keep automated backups of the build host to recover from any unexpected directory removal. Note that hex.pm's 2026-10-12 server-side restriction prevents new malicious 'app' values but does not retroactively clean releases published before that date, so old, unpinned dependency versions remain a residual risk.

Affected VersionsENISA

Gleam v0.32.4-erlang <v1.19.2-erlang
Gleam 0.32.4 <1.19.2
Gleam v0.32.4-node <v1.19.2-node
Gleam v0.32.4-erlang-slim <v1.19.2-erlang-slim
Gleam v0.32.4-node-slim <v1.19.2-node-slim
Gleam d13f27ee80aae7a521d2e9433c4deaf53f892574 <*
Gleam v0.32.4-elixir-slim <v1.19.2-elixir-slim
Gleam v0.32.4-scratch <v1.19.2-scratch
Gleam v0.32.4-elixir <v1.19.2-elixir
Gleam v0.32.4-elixir-alpine <v1.19.2-elixir-alpine
Gleam v0.32.4-node-alpine <v1.19.2-node-alpine
Gleam v0.32.4-erlang-alpine <v1.19.2-erlang-alpine

Affected Packages

euvd gleam fix: 1.19.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), specifically an unvalidated trust boundary between external package registry metadata and local filesystem operations. Hex.pm's release API exposes an 'app' field describing the release's OTP application name; Gleam reads this field when downloading dependencies and stores it via hex_manifest_package in compiler-cli/src/dependencies.rs, then feeds it into ProjectPaths::build_directory_for_package, which simply joins it onto the build path. Before hex.pm added a server-side restriction on 2026-10-12, a publisher could supply values containing '../' sequences or absolute paths, so the computed build directory escaped the project's build tree. When a dependency later fails to compile, Gleam's cleanup logic calls remove_dir_all on that path, turning a path-resolution bug into arbitrary directory deletion. The upstream fix (commits d13f27ee80aae7a521d2e9433c4deaf53f892574, d15c981fac6e533d70ac8ee89a6ef4dbf139adc3, 54bbb2b98af1505b6eed93c45b1936fc76412e5c) introduces a package_name_overrides map and an application_name() accessor so the build directory key is derived from a validated package identity rather than raw registry metadata. Affected CPE: cpe:2.3:a:gleam:gleam:*:*:*:*:*:*:*:* (version window 0.32.4 to <1.19.2).

Know when Gleam gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (EEF) PRIMARY 5.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

Malicious metadata is network-delivered (AV:N) but needs a failing dependency and victim build action, so AC:H and UI:R; no victim privileges (PR:N); deletion yields availability-only impact (A:H, C/I:N).

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 7.1 HIGH

Primary rating from Vendor (EEF).

CVSS VectorVendor: EEF

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in gleam-lang gleam allows a malicious package publisher to delete a directory outside the project's build directory when a developer builds a project.

A Hex package release's metadata carries an app field with the release's OTP application name. Gleam reads this field from the hex.pm release API when it downloads dependencies and uses it as the package's build directory name without validating it (hex_manifest_package in compiler-cli/src/dependencies.rs, ProjectPaths::build_directory_for_package). When a dependency fails to compile, Gleam deletes that directory with remove_dir_all. hex.pm didn't restrict the field to a directory name before 2026-10-12, so a publisher could set it to a value such as ../../../../target or an absolute path. When a project depends on such a release directly or transitively and the release fails to compile, gleam build, gleam check, gleam run, gleam test or gleam export deletes the directory the name resolves to. For a pure Gleam package no publisher code runs.

This issue affects gleam: from 0.32.4 before 1.19.2.

Threat Intelligence Overview

EPSS Score
0.4%
Top 67% exploitable
Prevalence
Low
Gleam is a niche, emerging programming language with small production footprint
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Vendor StatusVendor

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