What happened
On 23 November 2026 an attacker ran operating-system commands on six production web servers of Hex.pm, the package registry that Elixir and Erlang developers pull their dependencies from. The flaw they used had been sitting in the registry's code since 23 February 2016 — nearly a decade. It is tracked as CVE-2026-129514 and rated CVSS 10.0, the maximum, by the Erlang Ecosystem Foundation.
The maintainers had every server on a patched build within about fifteen minutes of the first malicious request. The attacker still had time to act: load-balancer logs recorded 69 exploit requests between 18:16 and 18:29 UTC.
How the bug worked
Hex.pm accepted some API request bodies in Erlang's external term format and decoded them with a function from the Plug.Crypto library in its "safe" mode. That mode refused functions and new atoms — but not maps. An Elixir struct is just a map with a __struct__ key naming a module, so a crafted request could pose as any struct the application had loaded, with every field chosen by the attacker.
The parser ran before routing and authentication, so an unauthenticated POST to any address on the site reached it. The forged struct made the request fail, and the error-reporting path then inspected it — a chain through the Plug, Ecto and DBConnection libraries that ended in the server calling a function of the attacker's choosing. That ran operating-system commands with the permissions of the registry's service account.
The fix, commit 379b0a2, makes the decoder reject any term containing a map with a __struct__ key and return HTTP 400.
What was — and wasn't — touched
Forensics found no unexplained database changes, no tampered packages or registry files, no persistent shells and no new cloud credentials. But database reads are not logged, so the team cannot rule out that the attacker read email addresses, password hashes, API key hashes, two-factor secrets, sessions and audit logs.
The most consequential open item is the registry signing key. It was within the attacker's reach and has not been rotated, because Hex has no key-rotation mechanism for it; one is now being built. Until new clients ship, the advice is to fetch packages only from repo.hex.pm and treat third-party mirrors as untrusted.
What users should do
- Change your password at hex.pm.
- Reset two-factor authentication by setting up a new authenticator entry and storing the new recovery codes.
- Log back in to the client with
mix hex.user auth(orrebar3 hex user auth). - Update the Hex client when the release with the new signing system ships; until then use only
repo.hex.pm. - Upgrade the related libraries: Ash to 3.38.0+ (CVE-2026-124283), db_connection to 2.10.3+ (CVE-2026-133555), flop to the latest (CVE-2026-130411).
- Watch for phishing: exposed addresses may be misused, so check that any email claiming to be from Hex links to hex.pm.
Why it matters
A package registry is the root of trust for everyone who builds on it. Hex.pm's own report notes the attacker had been downloading the registry's dependencies since 19 November — building a local copy to test against. The incident was reported to Sweden's IMY, to CISA and to ENISA, and CVE-2026-129514 was published on 24 November.
The registry itself was the target, and the signing key — the thing that tells every client a package is genuine — is still the open question.
Sources: https://hex.pm/blog/security-incident-on-hexpm and https://thehackernews.com/2026/11/hackers-exploited-cvss-100-hexpm-rce.html
