CVE-2026-96618: Hex exhausts memory and disk on oversized or compressed responses from an untrusted mirror

Published Oct 12, 2026
·
Updated

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 HEXMIRRORURL, HEXMIRROR or mirrorurl 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 :mixhexerltar.extract/2 without the 16 MiB compressed and 128 MiB decompressed limits that mixhextarball:unpackdocs/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 hexcore code that Hex vendors; that part is tracked in https://github.com/hexpm/hexcore/security/advisories/GHSA-7c4r-cgf9-9jmq.

This issue affects hex: from 0.11.2 before 2.5.2.

Affected Software

1 affected component
hex/hex>=0.11.2<2.5.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade hex to a version that resolves this vulnerability.

    Fixed in 2.5.2

Event History

Oct 12, 2026
CVE Published
via MITRE·03:29 PM
Data Sourced
via MITRE·03:29 PM
RemedyDescriptionWeakness
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Machines running Hex commands that fetch dependencies, package data, documentation, or API responses from a mirror configured through HEX_MIRROR_URL, HEX_MIRROR, or mirror_url are exposed. The mirror is treated as untrusted, but malicious responses can consume resources before signature and checksum validation occurs.

2

What does an attacker need to do to trigger the resource exhaustion?

An attacker needs control of, or the ability to influence responses from, the configured package mirror. They can send oversized responses, gzip-encoded responses that expand substantially when decompressed, or oversized package tarballs.

3

Are credential protections and package verification sufficient mitigation?

No. Hex does not send credentials to an untrusted mirror and verifies registry signatures and package checksums, but the affected response handling occurs before those checks. These protections do not prevent memory or disk exhaustion.

4

Which operations can be affected?

The issue can affect mix deps.get, mix deps.update, mix hex.package fetch, and mix hex.docs fetch. Registry, package, documentation, and API responses may be affected by unbounded response handling.

5

What can be done while patching is unavailable?

Avoid using untrusted or unneeded mirror endpoints, especially mirrors configured through HEX_MIRROR_URL, HEX_MIRROR, or mirror_url. Use a trusted mirror or remove the mirror configuration where operationally possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203