Skip to main content
All incident reports
Incident report

Hex.pm attacker ran commands on six servers through CVSS 10.0 flaw

An attacker used a maximum-severity flaw in the Hex.pm package registry to run operating system commands on six production servers on 23 November. The maintainers say no package was altered, but they cannot rule out that account data was read.

· First published

The short version

  • The attack. Sixty-nine exploit requests from two addresses reached Hex.pm, the package registry for Elixir and Erlang, between 18:16 and 18:29 UTC on 23 November. Files created by the exploit appeared on six production web servers.
  • The flaw. CVE-2026-129514 carries a CVSS score of 10.0 and sits in the parser that reads Erlang-format request bodies before routing and authentication. The safety check that would have blocked it was removed from the code in February 2016.
  • Packages intact. The team compared every database table against a copy taken two minutes before the first request and traced each difference to normal activity. The 23 releases published during the attack match the audit log and no older release was changed.
  • Account data at risk. Database reads and direct reads from file storage were not logged, so the team says it cannot rule out access to email addresses, password hashes, two-factor secrets, session data and private packages. Every user has been logged out while credentials are replaced.
  • Separate library fixes. Maintainers of the ash, db_connection and flop libraries shipped fixes for their own flaws involving structs built from untrusted data. The source describes these as separate disclosures, not further attacks on Hex.pm.

Timeline

DateEvent
February 2016A safety check is removed from the hex.pm request-body decoder, introducing the flaw that was later tracked as CVE-2026-129514.
23 NovSixty-nine exploit requests from two addresses arrive between 18:16 and 18:29 UTC; files created by the exploit appear on six web servers.
23 NovEvery hex.pm server is running the fixed build by 18:31 UTC.
23 NovA separate security report describing the same flaw arrives by email at 19:07 UTC, after the attack has ended.
23 NovHex.pm reports the breach to the Swedish data protection authority, CISA and ENISA.
24 NovThe Hex.pm team publishes its incident report, and fixed versions of the ash, db_connection and flop libraries are released.

How the flaw was exploited

The vulnerable code was a decoder for request bodies sent in an Erlang data format. It ran before routing and authentication, so an unauthenticated POST to any address on the site could reach it. The decoder blocked dangerous terms but accepted maps with a __struct__ key, letting a request body pose as any Elixir struct the application had loaded. A crafted struct ran nothing by itself; it caused an error, and the error-reporting path inspected the struct through the Ecto and DBConnection database libraries until the server called a function of the attacker's choosing. That call ran operating system commands with the permissions of the registry's service account. The fix makes the decoder reject any term containing a map with a __struct__ key.

Load balancer logs recorded the 69 requests from two addresses. In one case a file appeared three milliseconds after the request. Three of the six servers joined mid-attack, when a restart brought up machines still on the vulnerable build. Activity from the same two addresses going back to late the previous week suggests the attacker built a local copy of hex.pm to test against, according to the team.

What the checks found and what they could not

The package review traced every difference between the live database and the pre-attack copy to normal activity. The 23 releases published during the attack match the audit log, no older release was changed, and the package and registry files written that evening match the database records. The team found no leftover shells and no new accounts or cloud keys in the audit logs.

Database reads, shell commands, environment variables and direct reads from file storage were not logged, which is why the team says it cannot rule out that the attacker accessed data in the database. Every credential the attacker could have read has been replaced except the registry signing key. The keys that sign sessions and access tokens were replaced, logging all users out. API keys need no replacement: they are random 128-bit values stored only as HMAC-SHA256 hashes, which the team says cannot realistically be brute-forced. Passwords use bcrypt, which slows guessing but does not stop it for weak passwords.

Related library flaws and self-hosted registries

Three widely used Elixir libraries disclosed flaws of their own involving structs built from untrusted data and shipped fixes on 24 November: ash (CVE-2026-124283), db_connection (CVE-2026-133555) and flop (CVE-2026-130411). Each needs its own conditions to be exploited. The Ash flaw requires keyset pagination with a client-supplied cursor, certain sort field types and a signing secret left at its unset default. The DBConnection advisory says its flaw is not exploitable in that library alone, because another component must first decode untrusted data into structs. The Flop flaw has similar conditions around pagination cursors.

The exploited flaw is in the hexpm server code, not the Hex client, so organisations that run their own copy of the registry remain affected until they deploy the patch.

What is not known yet

  • Who carried out the attack, and whether the two source addresses can be attributed to a known group.
  • Whether the attacker actually read email addresses, password hashes, two-factor secrets, session data or private packages.
  • Whether the registry signing key, which has not yet been replaced, was among the credentials read.
  • Whether the flaw was exploited at any point before 23 November.
  • Whether the earlier activity from the two addresses was reconnaissance, testing against a local copy, or something else.

What to do

If you have a hex.pm account

  1. Change your hex.pm password.
  2. Reset two-factor authentication by setting up a new authenticator entry and storing the new recovery codes.
  3. Log back in to the client with mix hex.user auth, or rebar3 hex user auth for Erlang projects.
  4. Treat unexpected email about Hex as suspect and check that any link goes to hex.pm.

If you run your own copy of the registry

  1. Deploy the fix that makes the request-body decoder reject any term containing a map with a __struct__ key.

For Elixir and Erlang developers

  1. Until the new client ships, fetch packages only from repo.hex.pm and avoid third-party mirrors.
  2. Update the Hex client when the next release ships; it brings a new registry signing system.
  3. Upgrade ash, db_connection and flop to the fixed versions listed in their advisories.

Update log

  • First published.

Sources

New incident reports by email

One email a week with the reports published since the last one.

We email you about this topic only; unsubscribe any time. See our Privacy Policy.

Want us to look at your domain?

Give us one apex domain and we'll send back a written snapshot of what is already visible from outside. No call required.