Skip to content
TrustList
Security advisories

Hex.pm breach: Elixir registry users asked to reset passwords and 2FA

Editorial

By TrustList Editorial

An unauthenticated request chain ran commands on six hex.pm web servers on 23 November. Packages checked out clean, but database reads were not logged, so Hex asks every account to change its password and 2FA secret.

About Hex.pm breach: Elixir registry users asked to reset passwords and 2FA

Hex.pm breach: Elixir registry users asked to reset passwords and 2FA

24 November 2026: An attacker ran commands on six of hex.pm's web servers on 23 November through CVE-2026-129514, a flaw in how the registry for Elixir, Erlang and Gleam packages decoded unauthenticated requests. The Hex team found no altered packages and no database writes, but because database reads are not logged it cannot rule out that email addresses, password hashes, API key hashes, 2FA secrets, sessions and audit logs were copied. Every user is asked to change their password and set up a new authenticator secret.

The attack lasted 13 minutes. Hex's own timeline puts 69 malicious requests between 18:16 and 18:29 UTC; a firewall rule went in at 18:27, and by 18:31 every server had been replaced with a patched build. A security report describing the same flaw arrived by email at 19:07. Hex reported a personal data breach to IMY, the Swedish data protection authority, notified CISA and sent an early warning to ENISA that night, and published the CVE on 24 November.

A logging path that became an execution path

The entry point was a parser for the application/vnd.hex+erlang content type that ran before routing and authentication, so any POST to any route reached it. It used Plug.Crypto's safe decoder, which blocks functions and new atoms but let maps through, and an Elixir struct is only a map with a __struct__ key. A forged struct raised an error, and the error reporters (Sentry, Bandit's logger and the JSON log formatter) called inspect on it. From there the chain hopped through Ecto's Inspect implementation and a DBConnection stream whose :log option, taken from the request, named a function to run. That gave command execution as the BEAM's user.

The fix, hexpm commit 379b0a2, rejects any decoded term containing a struct and returns a 400. Hex also lists hardening for plug_crypto, plug, ecto and db_connection; the db_connection change is tracked as CVE-2026-133555.

What Hex checked, and what it could not

All 23 releases published during the incident match the audit log, no older release changed, and the 62 package files and 186 registry files written after 18:00 match the checksums in the database. Documentation archives have no stored checksum, and reads of private documentation are not logged. Reads of private packages in the window line up with releases those organisations published at the time, but a read from a compromised server would look like one of Hex's own; Hex says it will contact affected organisations directly.

The servers' credentials for storage, the CDN, email and the database were all rotated, along with the keys that sign sessions and tokens, which logged everyone out. The registry signing key could not be rotated yet. Hex is building a signing system that supports rotation and will ship new clients for it; until then it asks users to fetch packages only from repo.hex.pm and not to trust third-party mirrors.

Steps for teams that build on Hex

  • Change the password at hex.pm and, under Authenticator App on the security dashboard, choose Setup New App. This works even where an organisation requires 2FA, and it issues new recovery codes.
  • Point builds at repo.hex.pm only, and once the new client is out run mix local.hex --force and update rebar3 or Gleam.
  • Treat email that claims to come from Hex with care, since addresses may have leaked; forward doubtful ones to security@hex.pm.
  • Check for Ash. While investigating, Hex found the same class of flaw in Ash's keyset pagination, which could lead to command execution or SQL injection. Ash 3.38.0, released on 24 November, fixes it as CVE-2026-124283.

Unlike the agent-framework releases on PyPI earlier this month, where the packages themselves carried a credential stealer, the evidence here points at the registry's servers and account data rather than the code people downloaded.

Elixir shops in our catalogue

Much Elixir work is done by specialist agencies, and several are listed with us: AppUnite in Poland, Coletiv in Portugal, and Curiosum, Crafting Software, Hashrocket and Alembic, which builds with the Ash Framework and so has the extra Ash upgrade on its list. A client who has one of them maintaining a Phoenix or Ash application can reasonably ask whether its publishing accounts and CI API keys have been rotated, and whether any build fetches from a mirror.

Sources

Categories & features

TrustList Weekly

The week in software and IT, in one email

The news that matters to buyers, new rankings and our own research. Every Thursday, free, and easy to leave.

We will email you to confirm. Unsubscribe with one click in any issue. Privacy policy

You may be interested in