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-96618 Overview
CVE-2026-96618 is a data amplification vulnerability in hex, the package manager for the Erlang ecosystem used by Elixir and Mix. An untrusted package mirror configured through HEX_MIRROR_URL, HEX_MIRROR, or mirror_url can exhaust memory or disk space on machines running mix deps.get, mix deps.update, mix hex.package fetch, or mix hex.docs fetch. The vulnerability stems from Hex consuming responses in proportion to what the mirror sends before signature and checksum checks run. The issue affects hex from version 0.11.2 before 2.5.2 and is tracked as [CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)].
Critical Impact
A hostile mirror can trigger uncontrolled memory allocation or disk writes on developer and CI machines executing Mix dependency commands, enabling denial-of-service conditions against build pipelines.
Affected Products
- hexpm hex versions 0.11.2 through 2.5.1
- Elixir and Mix toolchains that resolve dependencies through a configured Hex mirror
- CI/CD build environments using mix deps.get, mix deps.update, mix hex.package fetch, or mix hex.docs fetch
Discovery Timeline
- 2026-10-12 - CVE-2026-96618 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-96618
Vulnerability Analysis
Hex treats mirrors configured via HEX_MIRROR_URL, HEX_MIRROR, or mirror_url as untrusted. It omits credentials and verifies registry signatures and package checksums the mirror cannot forge. However, several response paths consume memory or disk proportional to the mirror's payload before those integrity checks execute.
The function Hex.HTTP.request/5 reads the entire response body into memory and decompresses it with :zlib.gunzip/1 whenever Content-Encoding contains gzip. There is no limit on the compressed or decompressed size. Hex never requests compressed responses, so the mirror unilaterally decides whether this decompression runs. The behavior applies to registry, package, docs, and API responses.
Package tarballs have no download size limit. Hex 2.5.1 buffers the entire tarball in memory and writes it to the cache. The 16 MiB tarball limit is enforced only during unpack, and the tarball is extracted into deps/<app> before checksums are compared against the registry.
The commands mix hex.docs fetch and mix hex.docs offline write the docs tarball to disk and extract it with :mix_hex_erl_tar.extract/2, bypassing the 16 MiB compressed and 128 MiB decompressed limits applied by mix_hex_tarball:unpack_docs/3. The signed registry does not cover docs tarballs, so no integrity check applies.
Root Cause
The root cause is unbounded response processing before cryptographic validation. Hex decompresses gzip-encoded bodies and extracts tarballs without enforcing size ceilings, violating the principle of validating input before expanding it.
Attack Vector
An operator who has configured an untrusted Hex mirror serves highly compressed gzip payloads or oversized tarballs. When a developer or CI job runs a Mix fetch command, the Hex client allocates memory or disk proportional to the attacker-controlled payload. The attack requires user action (running a Mix command) and a mirror already present in the victim's configuration.
# Patch excerpt from lib/hex/repo.ex introducing a 16 MiB response cap
-----END PUBLIC KEY-----
"""
+ # Responses from a repository, which can be an untrusted mirror, are limited
+ # to the largest file Hex downloads from one, a package or docs tarball,
+ # which hex_core limits to 16 MiB with tarball_max_size and
+ # docs_tarball_max_size
+ @max_body_size 16 * 1024 * 1024
+
def fetch_repo(repo) do
repo = repo || "hexpm"
repos = Hex.State.fetch!(:repos)
Source: GitHub Hex Commit bb5189e
Detection Methods for CVE-2026-96618
Indicators of Compromise
- Mix processes (beam.smp running mix deps.get, mix deps.update, or mix hex.*) consuming anomalous amounts of resident memory or writing unusually large files to deps/, the Hex cache, or temporary directories.
- Outbound HTTPS traffic to a non-canonical Hex mirror host (anything other than repo.hex.pm) returning gzip-compressed responses with high expansion ratios.
- Build or CI job failures with out-of-memory kills or disk-full errors correlated with Hex fetch commands.
Detection Strategies
- Inventory environments for HEX_MIRROR_URL, HEX_MIRROR, and mirror_url settings in shell profiles, CI configuration, and ~/.hex/ state; flag any value that is not the canonical hexpm repository.
- Monitor process-level memory and disk I/O for Erlang VM processes invoked by Mix during dependency resolution, alerting on sudden spikes above historical baselines.
- Correlate HTTP response headers from mirror hosts (Content-Encoding: gzip, Content-Length) with observed on-disk tarball sizes to identify amplification ratios exceeding reasonable thresholds.
Monitoring Recommendations
- Enforce logging and allowlisting of outbound destinations from CI runners so Hex traffic flows only to approved repositories.
- Capture Mix command exit codes and resource telemetry in build logs to detect repeat denial-of-service patterns.
- Review the Hex security advisory GHSA-gf42-pg2f-63jp and the related hex_core advisory GHSA-7c4r-cgf9-9jmq for upstream detection guidance.
How to Mitigate CVE-2026-96618
Immediate Actions Required
- Upgrade hex to version 2.5.2 or later on all developer workstations, build agents, and container images.
- Audit and remove untrusted mirror configurations unless the mirror operator is explicitly trusted and operationally monitored.
- Rebuild cached dependencies after upgrade to ensure extraction occurs under the new bounded code paths.
Patch Information
The fix lands in Hex 2.5.2 across three commits. Commit bb5189e bounds mirror responses to a @max_body_size of 16 MiB and constrains docs extraction. Commit 0895610 hardens offline and cache fallback behavior in lib/hex/scm.ex. Commit 51ea632 ensures registry signatures are retrieved and verified. Refer to the CNA advisory and OSV entry EEF-CVE-2026-96618 for complete references.
Workarounds
- Unset HEX_MIRROR_URL and HEX_MIRROR environment variables and remove mirror_url entries from Hex configuration until upgrading.
- Restrict CI/CD egress to the canonical repo.hex.pm endpoint via network policy or proxy allowlists.
- Impose per-process memory and disk quotas (for example, ulimit -v, cgroup limits) on Mix invocations to cap worst-case resource consumption.
# Verify installed Hex version and upgrade to the patched release
mix hex.info
mix local.hex --force
# Remove untrusted mirror configuration from the current shell
unset HEX_MIRROR_URL
unset HEX_MIRROR
# Inspect Hex configuration for a mirror_url entry
mix hex.config
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

