Insufficient verification of Hex package metadata in Gleam
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 1.18.0, v1.18.0-elixir, v1.18.0-elixir-slim, v1.18.0-elixir-alpine, v1.18.0-erlang, and 6 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
Insufficient Verification of Data Authenticity vulnerability in Gleam allows an adversary in the middle to substitute forged Hex package contents during dependency resolution. During dependency resolution Gleam fetches package metadata from the signature-verified Hex repository, which covers each release's dependency requirements and SHA-256 outer_checksum. After resolving versions, gleam_cli::dependencies::lookup_package makes a second request to the unsigned Hex API through gleam_core::hex::get_package_release and records the outer_checksum and dependency names from that JSON response into manifest.toml, instead of the values from the verified repository metadata. The Hex repository signature does not cover the API response. An adversary in the middle who can intercept TLS with a certificate trusted by the Gleam process (for example a TLS-inspecting proxy using a CA in the operating system trust store or added through GLEAM_CACERTS_PATH), and who can modify both the API release response and the corresponding repository tarball, can supply a package archive with a matching forged checksum without the Hex repository signing key. Gleam verifies the forged tarball against the forged checksum, accepts it, and extracts it as a dependency source, resulting in loss of integrity of the downloaded package contents. Only projects that resolve or update Hex dependencies are affected, which happens when the manifest is missing, a dependency is added or updated, or dependency requirements change. Builds that reuse an unchanged, known-good manifest.toml continue to verify tarballs against its pinned checksum. This issue affects gleam: from 0.18.0 before 1.18.0.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- gleam.run/gleam
From 0.18.0 · fixed in 1.18.0
- gleam-lang/gleam
From 0.18.0 · fixed in 1.18.0
- gleam-lang/gleam
From v0.18.0-elixir · fixed in v1.18.0-elixir; From v0.18.0-elixir-slim · fixed in v1.18.0-elixir-slim; From v0.18.0-elixir-alpine · fixed in v1.18.0-elixir-alpine; From v0.18.0-erlang · fixed in v1.18.0-erlang; From v0.18.0-erlang-slim · fixed in v1.18.0-erlang-slim; From v0.18.0-erlang-alpine · fixed in v1.18.0-erlang-alpine; From v0.18.0-node · fixed in v1.18.0-node; From v0.18.0-node-slim · fixed in v1.18.0-node-slim; From v0.18.0-node-alpine · fixed in v1.18.0-node-alpine; From v1.6.0-scratch · fixed in v1.18.0-scratch