Hex.pm hit by command execution bug, warns package data may have been read

Attackers sent 69 crafted requests to six hex.pm web servers on November 23. Hex says nothing was modified, but database reads aren't logged, so exposure can't be ruled out.

On this page

Hex, the package manager for Elixir and Erlang, says someone got command execution on its web servers on November 23 and that it can't rule out that they read the database. The company found no evidence of package modifications, database changes or lingering access. It also can't show the opposite for reads, because reads aren't logged.

What happened

Between 18:16 and 18:29 UTC, the attacker sent 69 malicious requests, which reached six web servers. At 18:30 Hex swapped in patched servers that rejected the payload, and a firewall rule blocked the attacker's traffic at 18:33. SecurityWeek, which reported the disclosure on November 27, describes the defect as fixed within 20 minutes.

The bug is an unauthenticated deserialization flaw in the parser that handles application/vnd.hex+erlang request bodies, tracked as CVE-2026-129514 with a CVSS score of 10. Hex's own advisory says it was actively exploited against the hex.pm service on 2026-11-23.

Hex replaced the credentials its servers could reach: storage, CDN, email and database credentials, plus the keys that sign sessions and access tokens. That logged everyone out of hex.pm and out of Hex clients.

How the bug works

The parser decodes the request body with Plug.Crypto.non_executable_binary_to_term/2, which accepts maps carrying a __struct__ key. The decoded term becomes the request params, and the parser runs in the endpoint before routing and authentication, so a POST to any route reaches it. Elixir dispatches protocols on that __struct__ key, so the client picks which Inspect and Enumerable implementations run when error reporting inspects the params. A chain through Ecto.Query.DynamicExpr and DBConnection.Stream ends at an apply/3 call on a {module, function, args} tuple taken from the body.

The same class of bug turned up elsewhere in the Elixir stack. Hex found the Ash Framework was affected too; Ash patched it on November 24, warning of code execution or SQL injection through a forged keyset pagination cursor. SecurityWeek also lists fixes in db_connection and flop. The Ash advisory describes a related mechanism: a struct in a cursor value for a :ci_string, :map, :struct or :term sort field reaches the data layer, and with AshPostgres a struct passed to inspect/1 runs the Inspect implementation of whichever module the attacker chose.

HackZoneLabs assessment

The interesting part here isn't the CVSS 10. A pre-auth RCE in a package registry is bad in an obvious way, and Hex's timeline is quick: 13 minutes of requests, containment within a few more. What matters is the shape of the uncertainty. Hex says it found no evidence of modification, and that's a real finding, but it's weaker than it sounds. Reads of the database and of private documentation aren't logged, and any read coming from a compromised server would look like normal traffic. So "no evidence" here means "no way to see it", not "it didn't happen".

In our view, the credential rotation is the part that limits damage. If the attacker's commands could read the credentials the servers use, then email addresses, password hashes, API key hashes, sessions, second factor secrets and audit logs were all reachable by the same route. Rotating signing keys and logging everyone out is the right call, and it's also an admission that the old keys can't be trusted.

We'd also read the Ash disclosure as the more portable lesson. The pattern, a struct key that decides which code runs, is a property of how Elixir dispatches protocols, not of one parser. Anyone running Elixir services that decode terms from the network should assume the same shape of bug is possible in their own code and look for it before someone else does.

What's still unknown, and what to do

Nobody has published how the attacker found the bug, or whether they were after anything specific. Hex hasn't said whether the exposed data was actually read, and given the logging gap it may never be able to.

For account holders, Hex's advice is concrete: change your hex.pm password and reset two-factor authentication. Because email addresses may have been exposed, treat mail claiming to be from Hex with suspicion and check that links go to hex.pm. Until new Hex client versions ship with the registry signing system Hex is building, fetch packages only from repo.hex.pm and not from third-party mirrors.

For teams running Elixir or Erlang services, the priority is the dependency side. Check whether Ash, db_connection or flop are in your tree and whether you're on a fixed version. Then look at your own request parsers: anything that turns untrusted bytes into terms and then inspects or enumerates them deserves a hard look.

CVE references

CVE-2026-129514

CVE-2026-124283

Sources

  1. Hex Package Manager Warns of Potential Data BreachPrimarywww.securityweek.com

If something here is wrong, tell us. Every correction is listed on the corrections page.

Don’t Just Read About Cyberattacks. Learn How They Work.

Go beyond the headlines. Explore hands-on cybersecurity labs, understand real-world vulnerabilities, and build practical security skills with HackZoneLabs.

Start Learning