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

CVE-2026-105274: hex_core Data Amplification DOS Vulnerability

CVE-2026-105274 is a data amplification denial of service vulnerability in hex_core that allows untrusted repository mirrors to exhaust Erlang VM memory through compressed data. This article covers technical details, affected versions in hex_core, Hex, and rebar3, impact analysis, and mitigation strategies.

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-105274 Overview

CVE-2026-105274 is a data amplification vulnerability affecting hex_core, the client library used by the Hex package manager and rebar3 build tool for Erlang and Elixir. An untrusted repository mirror, or a server responding to hex_core API requests, can serve a highly compressed payload that exhausts memory in the Erlang VM running the client. The flaw is categorized as CWE-409: Improper Handling of Highly Compressed Data.

The vulnerable code is vendored into Hex (mix_hex_repo, mix_hex_api) and rebar3 (r3_hex_repo, r3_hex_api), expanding the exposure across the Erlang/Elixir developer ecosystem.

Critical Impact

A malicious mirror can decompress tiny registry responses into arbitrary-sized envelopes before the signature check runs, exhausting Erlang VM memory on developer and CI machines.

Affected Products

  • hex_core from 0.1.0 before 0.20.0
  • hex (Mix package manager) from 2.1.0 before 2.5.2
  • rebar3 from 3.9.1 before 3.27.3

Discovery Timeline

  • 2026-10-12 - CVE-2026-105274 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2026-105274

Vulnerability Analysis

The vulnerability sits in two code paths within hex_core. The repository client functions hex_repo:get_names/1, hex_repo:get_versions/1, hex_repo:get_package/2, and hex_repo:get_policy/2 fetch a registry response, decompress it with zlib:gunzip/1, and decode the signed envelope before verifying the signature. An attacker controlling the compressed bytes can produce a small response that expands to an arbitrarily large envelope, consuming memory before the signature mismatch causes rejection.

The second path is in hex_api. Responses using the application/vnd.hex+erlang content type are decoded through hex_safe_binary_to_term:safe_binary_to_term/1, which calls binary_to_term(Binary, [safe]). The safe option blocks atom creation and later rejects functions and ports, but it does not reject compressed terms and does not bound the decoded size. The term is fully materialized before the function/port check runs.

Root Cause

The root cause is ordering: decompression and term construction occur before validation. The fix for CVE-2026-21619 introduced the safe option but did not add a size limit on decoded terms.

Attack Vector

An attacker who operates a Hex repository mirror, intercepts traffic through a man-in-the-middle, or compromises an API endpoint can return crafted gzip or compressed-term payloads. When a developer runs mix deps.get, rebar3 compile, or any command that fetches package metadata, the Erlang VM allocates memory proportional to the decompressed payload rather than the on-wire size.

text
// Patch excerpt from rebar3 commit 360838a22f5b3a88c0358207f2923059bcbb3afb
-%% Vendored from hex_core v0.19.0, do not edit manually
+%% Vendored from hex_core v0.20.0, do not edit manually

%% @doc
%% Hex HTTP API

Source: rebar3 commit 360838a2. The patch bumps the vendored hex_core to version 0.20.0, which bounds decompressed sizes and validates envelopes before full materialization.

Detection Methods for CVE-2026-105274

Indicators of Compromise

  • Unexpected memory spikes or out-of-memory crashes in the beam.smp process during package fetch operations such as mix deps.get, mix hex.search, or rebar3 compile
  • HTTP responses to /names, /versions, or /packages/<name> endpoints with gzip ratios exceeding typical registry payloads
  • Build or CI job failures correlated with requests to non-canonical Hex mirrors or recently reconfigured repository URLs

Detection Strategies

  • Inventory hex_core, hex, and rebar3 versions across developer workstations and CI runners, flagging versions below hex_core 0.20.0, hex 2.5.2, and rebar3 3.27.3
  • Audit mix.exs, rebar.config, and ~/.hex/hex.config files for custom repository URLs pointing at untrusted mirrors
  • Review network logs for TLS connections from build agents to hosts that are not repo.hex.pm or an organization-approved private Hex instance

Monitoring Recommendations

  • Alert on beam.smp resident memory growth beyond baseline thresholds on build servers
  • Monitor outbound HTTPS from CI runners and restrict package registry destinations with an egress allow-list
  • Track Hex and rebar3 upgrade compliance through endpoint software inventory telemetry

How to Mitigate CVE-2026-105274

Immediate Actions Required

  • Upgrade rebar3 to 3.27.3 or later on all developer and CI systems
  • Upgrade hex (Mix) to 2.5.2 or later using mix local.hex
  • Upgrade projects that embed hex_core directly to version 0.20.0 or later
  • Remove or re-validate any configured third-party Hex mirrors; prefer the official repo.hex.pm or a trusted private instance

Patch Information

The fix is distributed through hex_core 0.20.0 and the downstream re-vendors in hex 2.5.2 and rebar3 3.27.3. Details are documented in the GitHub Security Advisory GHSA-7c4r-cgf9-9jmq and the CNA advisory on cna.erlef.org. The relevant commits are hex_core ebe25d11 and hex_core fbb6d9de.

Workarounds

  • Pin package manager clients to only use https://repo.hex.pm and verified private mirrors you control
  • Restrict CI egress to approved registry hosts to block redirection toward attacker-operated mirrors
  • Enforce TLS certificate validation and avoid environment variables that disable it during package fetches
bash
# Upgrade Hex and verify installed versions
mix local.hex --force
mix hex.info

# Upgrade rebar3
rebar3 local upgrade
rebar3 --version

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.