Hex.pm Breached via CVE-2026-129514 (CVSS 10.0): Unauthenticated Erlang-Term RCE Hit Six Registry Servers in 13 Minutes — No Tampered Packages Found, but Every User Must Change Password and Reset 2FA

DevSecOps · 2026-11-25 · By Reef Administrator - H.A

Hex.pm Breached via CVE-2026-129514 (CVSS 10.0): Unauthenticated Erlang-Term RCE Hit Six Registry Servers in 13 Minutes — No Tampered Packages Found, but Every User Must Change Password and Reset 2FA

Attackers exploited a forged-struct deserialisation flaw in hex.pm's Erlang request parser to run commands on six servers on 23 November; Hex patched within minutes, found no altered packages, but cannot rule out database reads and asks all users to change passwords and reset 2FA.

Attackers used a critical flaw in hex.pm, the package registry for Elixir, Erlang and Gleam, to run operating system commands on six of its production servers on 23 November. The bug is tracked as CVE-2026-129514 (CVSS 4.0 score 10.0, CWE-502). Hex says the attack lasted about 13 minutes and that it found no tampered packages. It cannot rule out that the attacker read the user database, so every hex.pm user is being asked to change their password and set up two-factor authentication (2FA) again.

What Happened

Hex has published a detailed timeline. The attack came from two IP addresses:

In total the attacker sent 69 malicious requests. Hex also saw repeated downloads of hex.pm's own dependencies from 19 November. It says this "suggests the attacker built a local copy of hex.pm to test against."

At 23:07 (19:07 UTC) Hex received a security report by email describing the same vulnerability. Over the next day it rotated most of its infrastructure credentials. It notified IMY, Sweden's data protection authority, at 02:58 Mauritius time on 24 November (22:58 UTC on 23 November). It reported the incident to CISA at 03:05 (23:05 UTC) and sent an early warning to ENISA. The Erlang Ecosystem Foundation, acting as the CNA, published the CVE at 17:48 Mauritius time (13:48 UTC) on 24 November, together with GitHub advisory GHSA-9pmm-hf4r-27pg.

Technical Details

The Hex command-line clients can send requests to the registry as Erlang terms (content type application/vnd.hex+erlang). hex.pm decoded these bodies with Plug.Crypto.non_executable_binary_to_term/2 in safe mode. That decoder refuses functions and new atoms, but it does not restrict maps. So a map carrying a __struct__ key passes through as if it were an Elixir struct of any module the attacker names.

The parser ran before routing and authentication, so no login was needed. Every route was reachable. According to the advisory, the chain worked like this:

Hex says a check that would have blocked this was removed in February 2016. The advisory lists every hexpm commit from ab1bbce up to, but not including, the fix as affected. The fix, commit 379b0a2 ("Refuse structs in Erlang term request bodies"), makes decoding fail with HTTP 400 if any map in the term has a __struct__ key.

Fixes are also going into shared libraries so other applications cannot be chained the same way. db_connection will stop applying :log callbacks taken from stream structs (CVE-2026-133555, fixed in 2.10.3). Work is also under way in plug, plug_crypto and ecto.

What May Have Been Exposed

Hex says it found "no evidence of unauthorized package modifications, or database changes." It checked that all 23 releases published during the incident match audit-log entries. It also checked that all 62 package files and 186 registry files written since 18:00 UTC match their database checksums. Documentation archives have no stored checksums, so they could not be checked the same way.

Database reads are not logged, so Hex cannot rule out that the attacker read email addresses, password hashes, API key hashes, 2FA secrets, sessions and audit logs. It also cannot rule out reads of private packages and private docs, and says it will contact the affected organisations directly. The advisory also notes that the attacker's code could read the server's environment, which holds "the database URL, the storage credentials and the registry signing key."

What Hex Has Rotated

What To Do Now

If you have a hex.pm account:

mix hex.user auth
# or, for rebar3 users
rebar3 hex user auth

For teams and operators:

Why It Matters

Package registries are prime supply-chain targets. Here the most damaging outcome, poisoned packages, appears to have been avoided. Hex saw the attack fast, patched within about a quarter of an hour, and published a detailed timeline within a day. The incident still shows two lessons. First, "safe" deserialisation is not safe on unauthenticated input once forged structs can reach protocol code like inspect/1. Second, a signing key that cannot be rotated becomes a problem the moment a server is compromised. Until Hex ships its new signing system, the usual advice applies: use the official repository and lock dependency versions with checksums.

Sources

REEF SENTINEL