Executive brief
Gleam is a programming language and build tool that automatically downloads software libraries (packages) from the Hex repository. A security flaw in how Gleam verifies these downloads allows a sophisticated attacker to intercept the connection and replace legitimate code with malicious software. This could lead to the compromise of a developer's machine or production servers when new dependencies are added or updated.
Technical details
A vulnerability exists in the Gleam CLI dependency resolution process (specifically in gleam_cli::dependencies::lookup_package). While Gleam initially fetches signed metadata, it performs a subsequent request to an unsigned Hex API and prioritizes the checksum from this unsigned response when creating the manifest.toml file. An attacker capable of intercepting TLS traffic (e.g., via a trusted proxy or compromised CA) can provide a forged API response and a matching malicious tarball. Because Gleam validates the malicious tarball against the forged checksum rather than the signed repository metadata, it accepts the compromised package. This affects projects during dependency resolution or updates; projects with existing, unchanged manifests are not impacted.
Affected products
- Gleam-lang Gleam from 0.18.0 before 1.18.0
Timeline
- 2026-07-29: disclosed: Vulnerability published by Erlang Ecosystem Foundation CNA
References
- https://gleam.run/
- https://github.com/
- https://ghcr.io/
- https://cna.erlef.org/cves/CVE-2026-59247.html
- https://github.com/gleam-lang/gleam/commit/c9c0d48c123c8abae6db8dd61b25ccb427ed3d35
- https://github.com/gleam-lang/gleam/security/advisories/GHSA-4vvc-458m-r82g
- https://github.com/hexpm/specifications/blob/main/registry-v2.md