Skip to main content
Vulnerability Database/CVE-2026-105280

CVE-2026-105280: Hex Package Manager Checksum Bypass Vulnerability

CVE-2026-105280 is an information disclosure flaw in Hex package manager that allows mirrors to bypass checksum validation and substitute tarballs. This post covers the technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105280 Overview

CVE-2026-105280 is an Improper Validation of Integrity Check Value vulnerability [CWE-354] in the hex package manager for the Elixir and Erlang ecosystem. The flaw lets a malicious package mirror substitute the tarball that mix hex.package fetch PACKAGE VERSION --output - writes to standard output. The standard output branch of the command skips the inner and outer checksum comparison that hex normally performs against the signed registry. A mirror configured through HEX_MIRROR_URL or mirror_url can therefore deliver altered bytes that downstream pipelines may unpack without integrity verification. The issue affects hex from version 0.20.2 up to version 2.5.2.

Critical Impact

A mirror can inject arbitrary tar archive content into automated pipelines that pipe mix hex.package fetch --output - into an unpacker, bypassing the registry checksum validation performed on the file-output branch.

Affected Products

  • hexpm hex versions from 0.20.2 up to (but not including) 2.5.2
  • Elixir and Erlang build pipelines using mix hex.package fetch --output -
  • CI/CD workflows that pipe fetched tarballs into tar extractors without separate verification

Discovery Timeline

  • 2026-10-12 - CVE-2026-105280 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-105280

Vulnerability Analysis

The hex package manager normally compares a fetched tarball's inner and outer checksums against the repository's signed registry before writing it to disk or unpacking it. When mix hex.package fetch is invoked with --output FILE, that validation runs and a mismatch aborts the operation. The --output - branch, which streams the response to standard output, writes the bytes returned by Hex.SCM.fetch/3 directly without invoking the comparison. Hex.SCM.fetch/3 does not verify freshly downloaded tarballs on its own, so a mirror configured through HEX_MIRROR_URL or mirror_url can serve substituted content that the command prints and exits successfully.

A secondary channel compounds the issue. hex prints diagnostic messages to standard output while the command runs, including bodies from failed HTTP responses on the update check or registry fetch and API warnings carried in the x-hex-message header. A mirror that answers one of those requests with an error whose body is a tar archive causes that archive to be written to standard output ahead of the verified tarball. Any pipeline that pipes stdout into a tar extractor will unpack the mirror-supplied archive, even if the later checksum check fails, because the content is already on the stream.

Root Cause

The root cause is missing integrity validation on the standard output code path of mix hex.package fetch. Checksum enforcement was coupled to the file-write branch rather than the fetch function Hex.SCM.fetch/3 itself. In addition, diagnostic output and the file transport share the same :stdio device, so untrusted bytes from HTTP error bodies and x-hex-message headers mix with the tarball stream.

Attack Vector

Exploitation requires an attacker-controlled mirror reached through HEX_MIRROR_URL or the mirror_url configuration setting, and a victim who runs mix hex.package fetch PACKAGE VERSION --output - and pipes the result into an unpacker. The attacker returns either a substituted tarball on the main response or a tar archive in the body of a failed update-check or registry response. The downstream consumer extracts files chosen by the attacker, enabling supply chain compromise of build output.

elixir
// Patch excerpt - lib/mix/tasks/hex.package.ex (commit d1f5a08)
// Adds the --output option that introduced the vulnerable stdout branch,
// later hardened to verify tarballs before writing to standard output.

  Fetch a package tarball to the current directory.

-      mix hex.package fetch PACKAGE VERSION [--unpack]
+      mix hex.package fetch PACKAGE VERSION [--unpack] [--output PATH]
+
+  You can pipe the fetched tarball to stdout by setting `--output -`.

Source: GitHub Commit d1f5a08

elixir
// Patch excerpt - lib/hex/shell/stderr.ex (commit 8a14632)
// Introduces a Mix shell that routes messages, prompts, and command output
// to :stderr so the stdout stream carries only the verified tarball bytes.

+defmodule Hex.Shell.Stderr do
+  @moduledoc false
+
+  # Mix shell for tasks that write data to stdout. Messages, prompts and
+  # command output are all printed to stderr.
+
+  @behaviour Mix.Shell
+
+  def print_app do
+    if name = Mix.Shell.printable_app_name() do
+      IO.puts(:stderr, "==> #{name}")
+    end
+
+    :ok
+  end
+
+  def info(message) do
+    print_app()
+    IO.puts(:stderr, IO.ANSI.format(message))
+  end
+
+  def error(message) do
+    print_app()
+    IO.puts(:stderr, IO.ANSI.format([:red, :bright, message]))
+  end

Source: GitHub Commit 8a14632

Detection Methods for CVE-2026-105280

Indicators of Compromise

  • Unexpected files appearing in build or deploy directories that consume output from mix hex.package fetch --output -.
  • Build-time outbound requests resolving to a mirror host other than the official repo.hex.pm, especially when HEX_MIRROR_URL or mirror_url is set.
  • HTTP error responses from the configured mirror that return large bodies with Content-Type suggesting tar archives.
  • hex versions in CI images reported as 0.20.2 through 2.5.1.

Detection Strategies

  • Inventory hex versions across build agents and developer workstations and flag any version at or above 0.20.2 and below 2.5.2.
  • Audit CI/CD pipelines for shell constructs that pipe mix hex.package fetch stdout into tar, xz, or similar extractors.
  • Review repository and environment configuration for non-default HEX_MIRROR_URL or mirror_url values and validate the mirror's provenance.

Monitoring Recommendations

  • Log and alert on changes to HEX_MIRROR_URL, mirror_url, or .hex configuration files in build images and runners.
  • Capture egress telemetry from build hosts and alert on hex HTTP traffic directed at unapproved hosts.
  • Record SHA-256 digests of fetched tarballs and compare them to the published checksums on hex.pm out of band.

How to Mitigate CVE-2026-105280

Immediate Actions Required

  • Upgrade hex to version 2.5.2 or later on all developer workstations, build agents, and container images.
  • Audit every pipeline that uses mix hex.package fetch --output - and either remove the stdout piping or validate the extracted content against a trusted checksum.
  • Unset HEX_MIRROR_URL and remove mirror_url entries unless the mirror is operated by a trusted party.

Patch Information

The fix ships in hex 2.5.2. Relevant commits include GitHub Commit 69489f8, GitHub Commit 8a14632, and GitHub Commit d1f5a08. The patch verifies tarballs on the standard output branch and redirects diagnostics to stderr via a new Hex.Shell.Stderr module. Full details are in the GitHub Security Advisory GHSA-98jr-23pm-vj7c and the CNA CVE-2026-105280 Details advisory.

Workarounds

  • Fetch tarballs with mix hex.package fetch PACKAGE VERSION --output FILE and verify the file on disk before unpacking, since the file-output branch enforces the checksum comparison.
  • Point hex only at the official repository and remove any mirror configuration from CI environments and shell profiles.
  • Wrap stdout-piping invocations with a verification step that computes the tarball checksum and compares it to the value published on hex.pm before extraction.
bash
# Pin hex to the fixed release and avoid the vulnerable stdout branch
mix local.hex --force --version 2.5.2

# Prefer file output so the registry checksum comparison runs
mix hex.package fetch my_package 1.2.3 --output ./my_package-1.2.3.tar

# Remove any mirror override before fetching
unset HEX_MIRROR_URL

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.