# CVE-2026-59247: Insufficient verification of Hex package metadata in Gleam

> A man-in-the-middle attacker can substitute forged Hex package contents during dependency resolution in Gleam, leading to code execution.

- **Severity:** High 7.6 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 29 Jul 2026
- **Updated:** 8 Sep 2026
- **Also known as:** EEF-CVE-2026-59247, GHSA-4vvc-458m-r82g, openSUSE-SU-2026:11462-1, openSUSE-SU-2026:21557-1

## What is CVE-2026-59247?

CVE-2026-59247 is a high-severity vulnerability in gleam-lang gleam, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity)

## Which versions are affected by CVE-2026-59247?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gleam` | openSUSE:Leap 16.0 | All versions | 1.18.1-bp160.1.1 |
| `gleam` | openSUSE:Tumbleweed | All versions | 1.18.1-1.1 |

## How do I fix CVE-2026-59247?

Upgrade to a fixed version.

## Is CVE-2026-59247 being exploited?

There is no known exploitation of CVE-2026-59247 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-59247 and fix it if it is affected.

What it is: CVE-2026-59247 is a high-severity vulnerability in gleam-lang gleam, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-59247 in the wild and no public exploit code.

Affected product: gleam-lang gleam. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-59247/ (Markdown: https://insights.sbomify.com/CVE-2026-59247/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-59247
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-59247
- OSV: https://osv.dev/vulnerability/CVE-2026-59247

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-59247/
Summaries are generated and may contain mistakes; the official description above is the record.
