"we cannot rule out that the attacker accessed data stored in the database," the Hex.pm team wrote after a Monday intrusion that let an attacker run operating system commands on six production hex.pm servers.
What happened and when
Hex.pm’s maintainers say a vulnerability tracked as CVE-2026-129514 with a CVSS score of 10.0 had existed in the registry’s code since a safety check was removed on February 23, 2016. Load balancer logs show 69 exploit requests between 18:16 and 18:29 UTC on Monday, all originating from two IP addresses. Files created by the exploit appeared on six web servers; in one case a file appeared just three milliseconds after the triggering request. Three servers were brought online mid-attack after a restart, and they were still running the vulnerable build.
How the flaw worked
The bug sat in the parser hex.pm used to decode request bodies sent in an Erlang data format. That parser ran before routing and authentication, so an unauthenticated POST could reach it. The decoder blocked some dangerous terms but accepted maps containing a __struct__ key. A crafted struct triggered an error; the error-reporting code then inspected the struct, and that inspection — via the Ecto and DBConnection libraries — reached a point where the server called a function of the attacker’s choice. That function executed operating system commands with the permissions of the registry’s service account.

Nobody's watching your logs at 2 AM.
Full SOC coverage without building one. Nubivance deploys and manages Rapid7 InsightIDR and MDR for organizations that need detection and response, not another dashboard.
Get coverageContainment, checks, and outstanding uncertainty
The Hex.pm team deployed a fix that makes the decoder reject any term containing a map with a __struct__ key, and every hex.pm server was running that patched build by 18:31 UTC on Monday. To verify integrity, the team compared every database table against a copy taken two minutes before the first exploit request and traced each difference to normal activity. The 23 releases published during the attack all match the audit log, no older release was changed, and package and registry files written that evening match database records.
However, database reads, shell commands, environment variables and direct reads from file storage were not logged, so the team said it cannot rule out that the attacker read data stored in the database. That database contains email addresses, password hashes, API key hashes, two‑factor authentication secrets, session data and private packages. The checks found no leftover interactive shells, no new accounts and no new cloud keys in the audit logs. Who was behind the attack remains unknown; activity from the two addresses going back to late last week suggests the attacker built a local copy of hex.pm to test against. A separate security report describing the same flaw arrived by email at 19:07 UTC on Monday, after the attack had ended.
What Hex.pm users should do now
- All accounts were logged out because the maintainers replaced the keys that sign sessions and access tokens. The team advises users to change their hex.pm password.
- Reset two‑factor authentication by creating a new authenticator entry and storing the new recovery codes.
- Log back into the client with mix hex.user auth (Elixir) or rebar3 hex user auth (Erlang).
- Update the Hex client when the next release ships, expected within days, which will include a new registry signing system.
- Watch for phishing: exposed email addresses may be misused, so verify that any Hex-related links go to hex.pm.
- API keys do not need to be replaced, the team says: they are random 128‑bit values stored only as HMAC‑SHA256 hashes and cannot realistically be brute‑forced. Passwords are hashed with bcrypt, which slows guessing; users with weak passwords should change them.
- Until the new client ships, fetch packages only from repo.hex.pm and avoid third‑party mirrors. The registry signing key had not yet been replaced and was among credentials the attacker could have read.
- Developers who never created a hex.pm account and only fetch public packages do not need to reset anything, Peter Ullrich clarified; those who signed up via GitHub should still log back into their clients and reset two‑factor authentication if they enabled it.
Related library fixes and implications for registry operators
Alongside Hex.pm’s incident, maintainers of three widely used Elixir libraries disclosed flaws involving structs built from untrusted data and shipped fixes. Those disclosures — for Ash, DBConnection and Flop — are separate and were not identified as further attacks on Hex.pm. Each library advisory notes conditions required to exploit the library; for example, the Ash issue needs keyset pagination with a client-supplied cursor, certain sort field types, and an unset default signing secret. The DBConnection advisory specifies that its flaw “is not exploitable in db_connection alone” because another component must first decode untrusted data into structs.
Because the exploited flaw sits in the hexpm server code rather than the Hex client, organizations that run their own copy of the registry are affected until they deploy the patch.
What this means for package consumers, registry operators, and security teams
- Package consumers: Users should change passwords, reset 2FA, and prefer repo.hex.pm until the client update is available; exposed email addresses increase phishing risk.
- Registry operators: Operators running private or self‑hosted copies of hex.pm must deploy the decoder fix — rejecting maps with __struct__ keys — to close the same attack path.
- Security teams and auditors: Because certain sensitive actions (database reads, shell commands, env var reads) were not logged, teams must treat the incident as one where confidential data may have been exposed and prioritize credential rotation and careful monitoring of downstream usage.
By yesterday morning the Hex.pm team had replaced every credential the attacker could have read except the registry signing key, and on Monday night it reported the breach to the Swedish data protection authority, to CISA in the United States and to ENISA in the European Union. The remaining, concrete open question is whether the attacker actually read secrets from the unlogged channels the team could not audit — a possibility the maintainers explicitly kept on the table.




