CVE-2026-96618 in hexinfo

Summary

by MITRE • 10/12/2026

Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in hexpm hex allows an untrusted package mirror to exhaust the memory or disk space of the machine running mix deps.get, mix deps.update, mix hex.package fetch or mix hex.docs fetch.

Hex treats a mirror configured with HEX_MIRROR_URL, HEX_MIRROR or mirror_url as untrusted: it doesn't send credentials to it, and it checks registry signatures and package checksums that the mirror can't forge. Several response paths consume memory or disk in proportion to what the mirror sends before any of those checks run.

Hex.HTTP.request/5 reads the whole response body into memory and decompresses it with :zlib.gunzip/1 whenever the response's Content-Encoding contains gzip, with no limit on the compressed or decompressed size. Hex doesn't ask for compressed responses, so the server decides whether this step runs. It applies to registry, package, docs and API responses.

Package tarballs have no download size limit. Hex 2.5.1 holds the whole tarball in memory and writes it to the cache, and the development branch streams it to a temporary file; the 16 MiB tarball limit is checked only when the file is unpacked. The tarball is then unpacked, into deps/<app> in 2.5.1 and into a staging directory on the development branch, before its checksums are compared with the registry.

mix hex.docs fetch, and mix hex.docs offline when docs are missing, write the docs tarball to disk and extract it with :mix_hex_erl_tar.extract/2 without the 16 MiB compressed and 128 MiB decompressed limits that mix_hex_tarball:unpack_docs/3 applies. The signed registry doesn't cover docs tarballs, so nothing checks them.

Registry responses are also decompressed before their signature is checked, in hex_core code that Hex vendors; that part is tracked in https://github.com/hexpm/hex_core/security/advisories/GHSA-7c4r-cgf9-9jmq.

This issue affects hex: from 0.11.2 before 2.5.2.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 10/12/2026

The vulnerability identified as Improper Handling of Highly Compressed Data, commonly referred to as data amplification or zip bomb attacks, resides within the Hex package manager for Elixir and Erlang projects. This flaw allows an untrusted package mirror to exhaust the memory or disk space of a machine executing commands such as mix deps.get, mix deps.update, mix hex.package fetch, or mix hex.docs fetch. Although Hex is designed with security in mind by treating mirrors configured via HEX_MIRROR_URL or similar environment variables as untrusted entities that do not receive credentials and are subject to registry signature and package checksum verification, the implementation contains critical flaws where resource consumption occurs before these integrity checks can take effect. The core issue stems from the system processing incoming data streams without adequate size constraints on either the compressed payload or its decompressed form, creating a vector for denial of service attacks against developers and build systems relying on Hex mirrors.

In the HTTP request handling logic, specifically within Hex.HTTP.request/5, the entire response body is read into memory and subsequently decompressed using :zlib.gunzip/1 whenever the Content-Encoding header indicates gzip compression. This process lacks any limit on the size of either the compressed data received from the server or the resulting uncompressed output in memory. Since Hex does not explicitly request compressed responses, the decision to compress lies entirely with the mirror operator, who can craft a response that is small when compressed but expands massively upon decompression. This behavior applies uniformly across registry lookups, package downloads, documentation fetches, and API interactions, meaning any endpoint contacted by these tools is potentially vulnerable if connected to a malicious or compromised mirror.

The handling of package tarballs presents another significant vector for resource exhaustion. In version 2.5.1 of Hex, the entire tarball is held in memory before being written to the cache directory, while later development branches stream it to a temporary file but still defer validation until unpacking begins. The critical failure here is that the enforced limit on package size, typically set at sixteen megabytes for compressed archives and one hundred twenty-eight megabytes for decompressed content, is only checked during the actual extraction phase into deps/<app> or a staging directory. This means an attacker can provide a tarball that appears small but expands to gigabytes of data upon unpacking, causing memory allocation failures or disk space exhaustion before the checksum verification against the signed registry occurs. The lack of pre-validation allows malicious actors to bypass integrity checks by triggering system resource limits first.

Documentation fetching operations via mix hex.docs fetch and mix hex.docs offline exhibit similar vulnerabilities when documentation files are missing locally. These commands write the incoming documentation tarball directly to disk and extract it using :mix_hex_erl_tar.extract/2 without applying the same size restrictions that govern package unpacking, specifically the sixteen megabyte compressed limit and one hundred twenty-eight megabyte decompressed limit found in mix_hex_tarball:unpack_docs/3. Furthermore, unlike packages which are covered by signed registry entries ensuring their integrity, documentation tarballs lack this cryptographic protection layer. Consequently, there is no mechanism to verify that a downloaded documentation archive matches expected metadata before it is processed and expanded on the local filesystem, leaving systems exposed to arbitrary resource consumption from untrusted sources.

Registry responses themselves are also susceptible to this amplification technique because they are decompressed prior to signature verification in hex_core code vendored by Hex. This specific aspect of the vulnerability is tracked separately under advisory GHSA-7c4r-cgf9-9jmq, highlighting that even metadata retrieval operations can be exploited to consume excessive memory resources before cryptographic validation confirms the authenticity and integrity of the registry data. The combination of these multiple attack surfaces across different command-line tools creates a comprehensive risk profile where any interaction with an untrusted mirror can lead to system instability or denial of service conditions due to unchecked resource expansion.

This vulnerability affects Hex versions ranging from 0.11.2 up to, but not including, version 2.5.2. The technical flaw aligns with CWE-409, which describes the improper handling of highly compressed data leading to memory exhaustion or disk space depletion. From a threat modeling perspective utilizing MITRE ATT&CK frameworks, this behavior corresponds to techniques involving resource consumption for denial of service purposes, particularly those leveraging algorithmic complexity vulnerabilities where input validation is insufficient relative to processing requirements. Mitigation strategies involve upgrading Hex immediately to version 2.5.2 or later which addresses these limits and ensures that size constraints are enforced prior to decompression and unpacking operations across all affected modules including package handling, documentation fetching, and registry response parsing.

Responsible

EEF

Reservation

10/10/2026

Disclosure

10/12/2026

Moderation

accepted

EPSS

0.00330

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!