Key points
- Between 18:16 and 18:29 UTC on Nov 23, the attacker sent 69 exploit requests and ran commands on six web servers; Hex blocked the traffic at 18:27 and had every server on a patched build by 18:30–18:31 — within 20 minutes.
- The bug was in the parser for the Erlang term format (application/vnd.hex+erlang): it blocked anonymous functions but still accepted maps carrying a __struct__ key, so the attacker could send forged structs — and the parser ran before routing and authentication, so every POST request reached it.
- The exploit chain went through Plug.MethodOverride, then error-printing code (Sentry, Bandit, JSON log formatter) and forged Ecto/DBConnection objects, ending in operating-system commands; each request still returned an ordinary 500 error.
- No evidence of tampered packages: all 23 releases published during the incident match the audit log, and all 62 package files and 186 registry files match the database checksums. But because database reads are not logged, Hex cannot rule out that emails, password hashes, API key hashes, 2FA secrets, sessions and audit logs were read.
- By 10:42 UTC on Nov 24, Hex had rotated storage, CDN, email and database credentials and the session and token signing keys — logging everyone out. The registry signing key cannot be rotated yet because the current system does not support it; new clients ship in the coming days.
- Same-class flaws were also found in Ash (CVE-2026-124283, fixed in ash 3.38.0 on Nov 24), db_connection (CVE-2026-133555) and flop (CVE-2026-130411).
The attack was not improvised. Hex says the attacker’s activity since Nov 19 suggests he built a local copy of hex.pm to test against — entirely possible because the hexpm server code is open source. About 35 minutes after the fix went live, Hex received an emailed security report describing the same vulnerability; the post does not name the reporter or say whether the report is connected to the attack.
What stands out is that Hex had just completed its first independent third-party security audit in April 2026 (funded by the OpenSSF), which fixed a different unsafe-deserialization bug in the hex_core client library. This one was on the server side — a safety check removed on Feb 23, 2016 that nobody noticed for over a decade. Hex reported the incident to Sweden’s data-protection authority (IMY), the US CISA and the EU agency ENISA on the evening of Nov 23.
Hex.pm users should do three things now: change their password, reset 2FA with a new authenticator app (and save the new recovery codes), then log the client in again with mix hex.user auth or rebar3 hex user auth. Until the new client ships, fetch packages only from repo.hex.pm and do not trust third-party mirrors. Anyone running their own copy of the open-source hexpm server should update to a build containing fix commit 379b0a2. Hex also warns users to watch for phishing: check that links in emails claiming to come from Hex actually point to hex.pm.
Why it matters
Hex.pm is the foundational infrastructure of the whole Elixir/Erlang/Gleam ecosystem — one poisoned package there would spread to thousands of projects. Fortunately no packages were tampered with this time, but the incident shows that even a recently audited registry can carry a critical flaw for 10 years — and that the attacker prepared for days before striking. For developers in Vietnam using Elixir/Phoenix, this is the moment to change the password and reset 2FA, not “tomorrow”.

