# Hex.pm hacked through a 2016 parsing bug: six registry servers hit, packages check out clean. Reset your 2FA

> An attacker ran commands on six hex.pm servers for about 13 minutes on November 23 through CVE-2026-129514, a request-parsing flaw that had been in the code since 2016. Hex says no package was altered, but it can't rule out that account data, including 2FA secrets, was read. Publishers should change their password and re-enrol 2FA; people who only download public packages have nothing to reset.

Published Nov 26, 2026 by TechMeasured Staff · Security · Canonical: https://techmeasured.com/security/hex-pm-hacked-cve-2026-129514-six-servers-packages-clean-reset-2fa-what-to-do

**An attacker ran operating-system commands on six of hex.pm's web servers on Monday, November 23, by exploiting a flaw in how the Erlang and Elixir package registry parsed request bodies.** The bug, CVE-2026-129514, is rated 10.0 (CVSS 4.0) by the Erlang Ecosystem Foundation, and the vulnerable code dates back to February 23, 2016, according to The Hacker News, the Cloud Security Alliance and Ostorlab, all summarising Hex's incident report.

Why it matters: Hex is the main package registry for Elixir and Erlang projects (Ostorlab counts 27,274 packages). Hex says its checks show no package was tampered with, but database reads weren't logged, so it can't rule out that the attacker read account records — including the secrets behind two-factor authentication. And the registry's signing key, which clients use to verify the package index, was within reach and had not been rotated as of the reports. *(We could not read Hex's own blog post while this run was unattended; facts below are from the fix commit, which we read directly, and from the four outlets listed.)*

## What happened, minute by minute (UTC, November 23)

| Time | Event (per CSA, Cyber Kendra, Ostorlab) |
|---|---|
| 18:16 | First exploit request; command execution evidence 46 seconds later |
| 18:16–18:29 | 69 exploit requests over about 13 minutes; a restart briefly brought up three more vulnerable servers, which is how six were hit |
| 18:26 | Fix commit by Hex maintainer Eric Meadows-Jönsson (19:26 CET in the commit) |
| 18:31 | Every server running the patch |
| 19:07 | An emailed security report arrives — after the attack was over |

The outlets say the attacker's two addresses had been downloading hexpm's dependencies since about November 19, suggesting they built a local copy of the site to test against. Nobody has been identified. Hex reported the incident to Sweden's data protection authority, IMY, and notified CISA and ENISA the same evening.

## How the bug worked

The fix commit spells it out. Hex accepts request bodies in an Erlang term format (`application/vnd.hex+erlang`), and that parser runs before routing and authentication, per The Hacker News — so any POST reached it. The decoder blocked executable terms but still accepted a map carrying a `__struct__` key. When error reporting (the commit names Sentry) inspected such a crafted value, Elixir dispatched to that struct's code, and a forged database-stream struct could be made to run an attacker-chosen function. The patch now rejects any decoded term containing a struct with a 400 error.

## What was and wasn't touched

- **Packages:** Hex says the 23 releases published during the attack match its audit log, no older release changed, and 62 package files and 186 registry files written that evening match the database (CSA, Cyber Kendra). Cyber Kendra notes the limits: a row changed and changed back wouldn't show, and docs have no checksum.
- **Account data — can't be ruled out:** email addresses, password hashes, API-key hashes, 2FA secrets, session data and audit logs; private packages may also have been read.
- **Rotated:** storage, CDN, email, database and session/token-signing credentials, by the morning of November 24 per Cyber Kendra. Everyone was logged out.
- **Not rotated:** the registry signing key. Hex hasn't said it was stolen and has seen no misuse, but it has no rotation mechanism yet; CSA says a new system is being built, and The Hacker News says updated clients are due within days.

## What to do

**If you publish packages or have a hex.pm account:**

1. Change your password at hex.pm.
2. Reset 2FA: at hex.pm/dashboard/security choose "Setup New App" under Authenticator App (per Cyber Kendra), delete the old authenticator entry and store new recovery codes.
3. Re-authenticate your tools: `mix hex.user auth` or `rebar3 hex user auth`.
4. API keys don't need replacing, Hex says, because they are random 128-bit values stored only as HMAC hashes. CSA suggests rotating CI publishing keys anyway if you want extra margin.
5. CSA advises watching for phishing aimed at Hex users and reporting it to security@hex.pm.

**If you only fetch public packages:** nothing to reset, according to Hex's Peter Ullrich as quoted by The Hacker News. Until the new client ships, fetch only from repo.hex.pm and avoid third-party mirrors, then run `mix local.hex --force` once the update is out.

**If you run a self-hosted hexpm server:** you are exposed until you deploy commit `379b0a2`. Ostorlab gives a quick check — `git merge-base --is-ancestor 379b0a29bcc95164249f38ad7d772a37a8ff9533 HEAD` — and suggests grepping access logs for `application/vnd.hex+erlang` requests. The Hex client itself is not affected.

Related libraries in the exploit chain also got fixes, per The Hacker News: db_connection 2.10.3 and ash 3.38.0 — worth updating in your own apps.


## Sources

1. [GitHub — hexpm/hexpm commit 379b0a2: Refuse structs in Erlang term request bodies](https://github.com/hexpm/hexpm/commit/379b0a29bcc95164249f38ad7d772a37a8ff9533)
2. [The Hacker News — Hackers Exploited CVSS 10.0 Hex.pm RCE Flaw to Compromise 6 Package Registry Servers](https://thehackernews.com/2026/11/hackers-exploited-cvss-100-hexpm-rce.html)
3. [Cloud Security Alliance Labs — Hex.pm Registry Server Compromise: When the Registry Is the Target](https://labs.cloudsecurityalliance.org/research/csa-research-note-hexpm-registry-server-compromise-20261125/)
4. [Cyber Kendra — Hex.pm Breach: CVE-2026-129514 Exploited, Reset Your 2FA](https://www.cyberkendra.com/2026/11/hex-pm-breach-cve-2026-129514.html)
5. [Ostorlab — Hex.pm Registry RCE, Exploited in the Wild (CVE-2026-129514)](https://blog.ostorlab.co/hexpm-registry-rce-exploited-cve-2026-129514.html)
