Keyrook

Hex.pm breached: attacker ran code on its servers — change your password and reset 2FA now

Hex.pm was breached on 23 November 2026 through a flaw that let an attacker run code on its servers. No packages were changed, but account details may have been read, so change your password and reset two-factor authentication now.

Timeline of the Hex.pm breach on 23 November 2026
The attack was blocked and fixed within about 20 minutes of the first exploit request.

Affects

  • Hex.pm

Tracked as

  • CVE-2026-129514Hex.pm · CVSS 10
  • CVE-2026-124283Ash
  • CVE-2026-133555db_connection
  • CVE-2026-130411flop

Hex.pm, the package registry for the Elixir and Erlang ecosystems, was breached on 23 November 2026. An attacker used a flaw in the service to run commands on its web servers. Hex fixed it within about 20 minutes, and says no packages were changed. But account details may have been read, so every Hex.pm user needs to change their password and set up two-factor authentication again.

Timeline of the Hex.pm breach on 23 November 2026
The attack was blocked and fixed within about 20 minutes of the first exploit request.

What happened

The flaw is CVE-2026-129514, scoring the maximum 10 out of 10. It gave unauthenticated remote code execution: an attacker with no account could send a crafted request and have the server run their commands. Hex.pm decoded request bodies written in Erlang term format before routing them or checking who sent them. The decoder blocked functions, but it let through maps carrying a __struct__ key — fake Elixir structs. When the service reported an error, it inspected that data, and the inspection ran code the attacker had chosen, ending in an operating-system command. The safety check that would have stopped this had been removed on 23 February 2016, so the flaw had existed for more than ten years. The fix rejects any term containing a __struct__ map with a 400 error.

The attack itself was short. All times are UTC, from Hex’s own account of the incident. The attacker’s first request of any kind came at 18:14:21. The first exploit request arrived at 18:16:00, and the last to reach a server at 18:29:33. In that window the attacker sent 69 malicious requests, and six web servers were affected — the first file appeared on a server 3 milliseconds after a request at 18:16:46, and a restart at 18:28 brought up three new servers that were still running the vulnerable build. A firewall rule went in at 18:27 and took full effect between 18:30 and 18:33; from 18:33:48 every further request from the attacking address was denied. Between 18:30 and 18:31 all servers were replaced with a patched build.

The response continued through the evening. Investigation began at 18:35. A replacement cloud key was created at 18:47 and the old one deactivated at 18:49. A security report email describing the same flaw arrived at 19:07. By 20:21 most infrastructure credentials had been rotated, with the database password following on 24 November. Hex reported the personal-data breach to Sweden’s data protection authority at 22:58, to CISA at 23:05, and gave early warning to ENISA at 23:26. By 10:42 on 24 November, every credential the attacker could have read had been rotated, except the registry signing key and a few low-impact secrets. CVE-2026-129514 was published at 13:48 on 24 November.

Hex found no evidence of modified packages, database changes or lasting access. No shells were found, and no new keys or accounts appeared. The checks are specific: all 23 releases published during the incident match the audit-log entries, and all 62 package files and 186 registry files written since 18:00 match the database checksums. No older release changed.

But there is a gap Hex is open about. Database reads are not logged, so Hex cannot rule out that the attacker read email addresses, bcrypt password hashes, HMAC-SHA256 API key hashes, two-factor authentication secrets, sessions and audit logs. Private-package reads in the period came from Hex’s own servers, but a read from a compromised server would look identical, so that cannot be fully ruled out either. Hex says it will contact affected organisations directly. Network traffic stayed near normal — one worker peaked at 0.47 MB/s against a usual maximum of 0.29 MB/s.

Hex also rotated storage, content-delivery, email and database credentials, plus the keys that sign sessions and tokens. That logged everyone out of hex.pm and out of Hex clients. The service is building a new registry signing system that supports key rotation, with new Hex client releases due in the coming days. Until then, Hex says to fetch packages only from repo.hex.pm and not to trust third-party mirrors.

The investigation found the same deserialisation weakness in three other projects. Ash needs an upgrade to 3.38.0 or later (CVE-2026-124283, fixed 24 November). db_connection versions 1.1.0 to 2.10.2 need an upgrade to 2.10.3 or later (CVE-2026-133555). flop versions 0.8.0 to 0.26.6, 0.27.0 to 0.27.2, 0.28.0 and 0.29.0 to 0.29.1 need an upgrade to the latest release (CVE-2026-130411). Hex’s logs also show the attacker repeatedly downloading hex.pm’s own dependencies since 19 November, suggesting they built a local copy of the service to test against. Hex did not publish the attacker’s IP addresses or commands.

What this means for you

If you use Hex.pm, the good news is real: the packages themselves were not tampered with, and the attack was stopped fast. The bad news is the part Hex cannot close. Because reads were not logged, nobody can prove your account details were not copied. A bcrypt password hash is hard to crack, but a weak password can still be guessed, and a two-factor secret in the wrong hands can be used to generate valid codes. That is why Hex is asking everyone to act, not just the people it can prove were affected.

The logout is a sign the response was taken seriously: rotating the signing keys threw every session out, so if you were signed in, you will have noticed. The signing-key change has a longer tail too. Until the new client releases arrive, the registry’s own signing key is one of the few secrets not yet rotated, which is why Hex is steering everyone to the official registry only.

For the wider Elixir and Erlang community, the lesson is the age of the flaw. A check removed in February 2016 left a hole open for more than a decade, and the same pattern turned up in three other projects. If you maintain Elixir libraries, check whether your own code decodes Erlang terms from untrusted requests.

What to do

  1. Change your Hex.pm password now. Do it even if your password is strong — the hashes may have been read, and weak passwords can be guessed.
  2. Reset two-factor authentication. Go to hex.pm/dashboard/security, under “Authenticator App” choose “Setup New App”, and verify a code. This gives you a new secret and new recovery codes — store them somewhere safe.
  3. Sign in again with your Hex client. Use mix hex.user auth, or the equivalent for rebar3, after changing your password.
  4. Update your Hex client when the release with the new signing system ships. Until then, fetch packages only from repo.hex.pm — do not trust third-party mirrors.
  5. If you signed up with GitHub, still do steps 2 and 3, and step 1 if you set a password. Your API keys do not need rotating: they are 128-bit random values stored as HMAC-SHA256 hashes, and Hex says brute force is infeasible.
  6. Watch for phishing. Email addresses may have leaked, so check that any link about Hex leads to hex.pm, and forward suspicious mail to Hex’s security team.
  7. If you use Ash, db_connection or flop, upgrade them to the fixed versions listed above.

A spoken summary of what to do · 0:20

Sources

  1. Security incident on hex.pmHex
  2. Hex.pm security incidentElixir Forum

More news

All the news
  1. Breach Watch4 min

    Felissimo breach: up to 1.66 million email addresses exposed, plus card data from 2005

    Felissimo said on 28 November that intruders reached its email and old web-service systems, potentially exposing up to 1.66 million email addresses and card details from services shut down 20 years ago.

  2. Breach Watch4 min

    Jagex confirms RuneScape breach: change your password and reset MFA

    Jagex said on 28 November that unauthorised access may have exposed RuneScape players' email addresses, hashed passwords and authenticator data. Logins are back online — change your password and set up MFA again.

  3. Breach Watch4 min

    College Board confirms breach — passwords reset, financial-aid form offline days before deadlines

    College Board confirmed on 27 November that attackers used AI tools to exploit a signup-page flaw, viewed names and emails, and reset passwords — and its CSS Profile form is offline days before 1 December deadlines.

    • College Board