An attacker exploited a critical flaw in hex.pm, the package registry for the Elixir and Erlang ecosystems, and ran operating system commands on 6 of its web servers on November 23, 2026. Hex says it found no tampered packages, but it cannot rule out that the attacker read its database, which holds user email addresses, password hashes, API key hashes, 2FA secrets, sessions and audit logs.
The project has rotated its infrastructure credentials, logged every user out, reported a personal data breach to Sweden’s data protection authority (IMY) and is asking all account holders to change their passwords and reset 2FA.
13 minutes of exploit traffic
In its incident report, Hex says the attacker sent 69 malicious requests to hex.pm between 18:16 and 18:29 UTC (1:16 to 1:29 p.m. ET). The Sentry error tracker logged an error for each one, which is how the team spotted the attack.
Hex added a firewall rule at 18:27 UTC that took full effect by 18:33, and replaced every hex.pm server with a patched build between 18:30 and 18:31. Six servers ended up running the attacker’s commands because a restart at 18:28 brought up 3 new servers that were still on the vulnerable build.
At 19:07 UTC, about 50 minutes after the first exploit request, Hex received an email security report describing the same vulnerability. The team reported the incident to IMY at 22:58 UTC, to the US Cybersecurity and Infrastructure Security Agency (CISA) at 23:05 and sent an early warning to ENISA, the EU cybersecurity agency, at 23:26.
A safety check removed in 2016
The flaw is tracked as CVE-2026-129514 and carries a CVSS score of 10.0. The Erlang Ecosystem Foundation’s CVE record describes it as unauthenticated remote code execution through deserialization of untrusted data.
hex.pm decoded request bodies sent with the application/vnd.hex+erlang content type using Plug.Crypto.non_executable_binary_to_term/2. That function blocks functions and new atoms but lets maps through, including maps with a __struct__ key that Elixir treats as real structs. Because the parser ran before routing and authentication, any unauthenticated POST request could reach it.
The attacker’s fake structs triggered an error, and the error reporting code ran inspect on them. A chain through Ecto.Query.DynamicExpr and DBConnection.Stream then executed a module, function and argument tuple supplied in the request, which gave the attacker OS command execution as the server’s user. Hex says git history shows the safety check in the decoder was removed on February 23, 2016, so the bug had been live for more than 10 years.
Hex’s fix in commit 379b0a2 makes the decoder reject any term containing a map with a __struct__ key and return a 400 error.
What Hex could and could not rule out
Hex compared a database copy from 18:13 UTC, just before the attack, against the live database and found no unexplained changes. It says all 23 releases published during the incident match its audit log, and all 62 package files and 186 registry files written after 18:00 UTC match the checksums in its database. It found no shells left on the servers and no new cloud keys, accounts or API calls from the attacker’s addresses.
Database reads, environment variable reads and shell commands are not logged, so Hex cannot say whether data was taken. One worker server peaked at 0.47 MB/s of network traffic, against a usual maximum of 0.29 MB/s. Reads of private documentation and direct reads from cloud storage are also not logged, and Hex says it will contact affected organizations directly.
Request logs going back to November 19 showed repeated downloads of hex.pm’s own dependencies from the attacker’s addresses. Hex says this suggests the attacker built a local copy of the service to test the exploit against.
What Elixir and Erlang developers should do
- Change your password at hex.pm. Passwords are stored as bcrypt hashes, which slow down guessing but do not stop it for weak passwords.
- Reset 2FA at hex.pm/dashboard/security by choosing “Setup New App” under “Authenticator App,” which creates a new secret and new recovery codes.
- Fetch packages only from repo.hex.pm and do not trust third-party mirrors until new Hex clients with a new registry signing system ship.
- Update the client with
mix local.hex --forceonce that release is out, and update rebar3 or Gleam if you use them. - Treat emails that claim to be from Hex with caution, since email addresses may have been exposed.
Hex says it does not plan to force API key rotation, because keys are 128-bit random values stored as HMAC-SHA256 hashes. It rotated every credential the attacker could have read by November 24, except the registry signing key and a few low-impact secrets. The signing key is being replaced by the new system that supports key rotation.
Same bug class found in Ash and other libraries
While investigating, Hex found the same class of flaw in the Ash framework, whose keyset pagination accepted crafted structs in client-supplied cursors. Ash fixed it in version 3.38.0 on November 24 as CVE-2026-124283. Related hardening is planned for plug_crypto, plug and ecto, and a db_connection issue is tracked as CVE-2026-133555.
Package registries remain a prime target for attackers looking to reach thousands of developers at once, as recent attacks on npm packages and PyPI have shown. No threat actor has claimed the hex.pm attack.












