Hex.pm Was Breached Through a Bug That Sat in Its Code Since 2016. Packages Check Out Clean. The Registry Signing Key Does Not, Yet: Stay Off Mirrors and Trust Your mix.lock.
Do this first, if you build Elixir, Erlang or Gleam software:
Fetch packages only from repo.hex.pm until the new Hex client ships. The Hex team's words: "Until then, don't trust third-party mirrors and fetch packages only from repo.hex.pm." In CI, look for the HEX_MIRROR, HEX_MIRROR_URL, HEX_TRUSTED_MIRROR_URL or HEX_TRUSTED_MIRROR environment variables, and a mirror_url or trusted_mirror_url in your Hex config. If any of them points somewhere other than repo.hex.pm, unset it for now.
Do not let builds re-resolve dependencies. Your mix.lock records a SHA-256 checksum for every package version you already use, and the Hex FAQ says checksums ensure users are informed "if they get a changed version of a package that they have already fetched and locked in their lockfile." Run CI with mix deps.get --check-locked so a build fails instead of quietly writing a new lock, and hold off on mix deps.update until the new client is out. Treat any lockfile diff in a pull request this week as something to read, not rubber-stamp.
If you have a hex.pm account: change your password at hex.pm, then reset two-factor authentication at hex.pm/dashboard/security (under "Authenticator App", choose "Setup New App"), and store the new recovery codes. You were already logged out everywhere, so log your clients back in (mix hex.user auth, or the rebar3 equivalent).
When the new Hex client is released "in the coming days," update it with mix local.hex --force, and update rebar3 or Gleam if you use them. That release carries a new registry signing system.
If you use Ash, db_connection or flop in your own applications, upgrade: ash 3.38.0 or later, db_connection 2.10.3 or later, and flop 0.26.7, 0.27.3, 0.28.1 or 0.29.2 depending on your branch. These are the same class of bug, found during the investigation. They are separate fixes, not further attacks on Hex.pm.
Watch your inbox. Email addresses may have been read, so expect phishing that claims to be from Hex. Check that every link goes to hex.pm and forward anything suspicious to [email protected].
If you never created a hex.pm account and only run mix deps.get, there is no password or 2FA to reset; asked exactly that on the Elixir Forum, Hex maintainer Peter Ullrich answered "this does not apply to you." The mirror and lockfile advice above still applies to you.
What happened
On Monday, November 23, 2026, an attacker ran operating system commands on six of Hex.pm's production web servers. Hex.pm is the package registry Elixir and Erlang developers fetch their dependencies from. The incident report, written by Peter Ullrich, Jonatan Männchen and Eric Meadows-Jönsson and dated November 24, gives the timeline in UTC:
18:16 to 18:29: "The attacker sent 69 malicious requests to hex.pm, six of our web servers were affected." The error tracker, Sentry, recorded an error for each request, starting at 18:16:00.
18:27: a firewall rule to block the attacker, in full effect between 18:30 and 18:33.
18:30 to 18:31: every server replaced with a patched build.
18:49: the AWS access key the affected servers used was deactivated.
19:07: an email arrived with a security report describing the same vulnerability, after the attack had already been stopped.
20:21: most infrastructure credentials rotated; the database password followed the next day.
22:58 to 23:26: reports to IMY (the Swedish data protection authority), CISA and ENISA.
November 24, 13:48: CVE-2026-129514 published.
Why six servers and not three: "a restart at 18:28 brought up three new servers still on the vulnerable build."
The flaw had been in the code a long time. The report says "the git history of the request decoder shows the safety check was removed on February 23, 2016." The GitHub advisory, GHSA-9pmm-hf4r-27pg, scores it CVSS 4.0 10.0 and marks it as exploited, and the attacker needed no account: the vulnerable parser ran "before routing and authentication, so a POST to any route reaches it."
How the bug worked, in plain terms
Hex clients can send requests in Erlang's own binary data format. Hex.pm decoded those request bodies with a function, Plug.Crypto.non_executable_binary_to_term, that refuses the obviously dangerous things (functions, new atoms) but does not refuse maps. In Elixir a struct is just a map with a __struct__ key naming a module, so an attacker could hand the server a fake struct pretending to be any module it had loaded.
That fake struct caused an error. Error reporting then printed the request data, and printing a struct runs code chosen by the struct's type. The attacker picked a chain: a fake Ecto query fragment whose printer walked a field without checking it, holding a fake db_connection stream whose error path ran a logging callback taken straight from the request. The callback was the attacker's chosen function, which, in the report's words, "led to OS command execution as the BEAM's user."
The fix, hexpm commit 379b0a2, rejects any decoded term containing a __struct__ key with a 400. The team is also working on deeper fixes in plug_crypto, plug, ecto and db_connection so the same chain cannot be rebuilt elsewhere.
If you run an Elixir application that decodes untrusted Erlang terms, this is the pattern to check in your own code: "safe" binary_to_term is not safe against forged structs. That is how the team found the same class of bug in Ash's keyset pagination cursors (CVE-2026-124283) and in flop's pagination cursors (CVE-2026-130411). The db_connection advisory (CVE-2026-133555) is explicit that its flaw is "not exploitable in db_connection alone": some other component has to decode untrusted data into structs first.
Confirmed, and not known
Confirmed by Hex's own checks:
No modified packages. "All 23 releases published during the incident match a publish or stage entry in our audit log, and no older release changed." All 62 package files written since 18:00 match the checksums in the database, and all 186 registry files written since 18:00 match the database contents.
No database writes. The team restored a copy of the database from 18:13:59, before the attacker's first request, and compared every row of every table with the live one. Every change is explained by an audit log entry, background jobs, or the team's own response. They note the limit honestly: a row changed and changed back would not show up.
No lasting access found. No shells in the running processes before the servers were replaced; no new keys, accounts or API calls from the attacker's addresses in the cloud audit logs.
Storage credentials not used from outside. All 6,279 requests by the production storage identity in the reviewed window came from the three node IPs, with no deletes, ACL changes, copies or bucket listings.
Not known, and Hex says so:
Database reads. "Because database reads are not logged, we cannot rule out that the attacker accessed data stored in the database, including email addresses, password hashes, API key hashes, 2FA secrets, sessions, and audit logs."
Private packages and docs. CDN logs show no requests from either attacker address to private docs, but direct reads from cloud storage are not logged, so a read "can't fully rule one out." Hex says it will contact affected organizations directly.
Who the attacker is. Not stated. The report does say requests from both attacker addresses since November 19 included "repeated downloads of hex.pm's own dependencies which suggests the attacker built a local copy of hex.pm to test against."
The registry signing key. This is the open item. The advisory says the server user "can read the environment of the application, which holds the database URL, the storage credentials and the registry signing key." By the morning of November 24 the team had rotated every credential the attacker could have read "except the registry signing key and a few low-impact secrets." A new signing system with key rotation is being built.
Why the signing key is the thing to think about
Hex's registry specification says every registry file is signed with the repository's private key, and clients verify that signature before trusting the package list and its checksums. That is what lets a mirror be untrusted: a mirror can serve you files, but it cannot forge a signed registry entry without the private key.
Our reading, not a statement from Hex: if that key was read on Monday, the signature no longer proves an index came from Hex.pm. Anyone holding it could sign a registry entry pointing at a doctored package with a matching checksum and serve it through a mirror or a hostile cache. Fetching directly from repo.hex.pm over HTTPS removes the mirror from that path, which is why Hex's advice is what it is. Versions already pinned in your mix.lock carry their own checksum, which a doctored tarball would not match. The exposure is in anything that resolves fresh: a new dependency, a mix deps.update, a CI job that builds without the lock. Hex found no sign of package tampering; this is about the gap between now and the new client, not about anything that has been shown to happen.
Two client settings deserve a look while you are in the config: unsafe_registry (environment variable HEX_UNSAFE_REGISTRY) turns off registry signature checking, and unsafe_https (HEX_UNSAFE_HTTPS) turns off certificate checking. Neither should be set anywhere, least of all this week.
API keys: Hex says you do not need to rotate
The report is specific: "API keys are 128-bit random values stored as HMAC-SHA256. We consider 128 bits of randomness far beyond the reach of brute force, so we don't see a need to rotate API keys because of the exposed hashes." Passwords are different. They are bcrypt hashes, which "slows guessing but doesn't prevent it for a weak password," hence the password change. If your organization's policy is to rotate CI publishing keys after any registry incident anyway, rotating a HEX_API_KEY costs little, but it is your policy, not Hex's advice.
Running your own copy of hexpm
The advisory lists the open-source hexpm/hexpm application as affected from commit ab1bbce (February 2016) until fix commit 379b0a2. If your organization runs its own deployment of that application, it is vulnerable until you deploy the fix. Hex's report does not address self-hosted deployments. The advisory names only the hexpm/hexpm application, so a private repository built with other tooling is not listed as affected; check which one you actually run.
Am I affected? Four checks
Mirrors: grep CI definitions, Dockerfiles and developer configs for HEX_MIRROR, HEX_TRUSTED_MIRROR, mirror_url and trusted_mirror_url. Anything other than repo.hex.pm, unset it until the new client ships.
Lockfile: run git log -p on mix.lock (and rebar.lock) for commits since November 23. For each changed line, confirm the version bump was intended. A checksum that changed while the version stayed the same is the line to stop on.
Account: sign in at hex.pm, change the password and reset 2FA. Hex asks anyone who notices "anything unusual in your account" to contact [email protected].
Libraries: mix deps or mix hex.outdated for ash, db_connection and flop; compare against the fixed versions above.
Our data
No indicators to feed. The report refers to "both attacker addresses" but does not publish them, and the advisory publishes none either. None published in the sources we read, so we added nothing to the feed.
Our edge: UNKNOWN, not zero. The exploit is an unauthenticated POST with an application/vnd.hex+erlang body to any route, so there is no exploit path to match, and our edge records keep paths, not request bodies or content types. We also do not run hexpm. Our edge-check tool found one harvested proof-of-concept repository for the CVE and no usable fingerprint in it.
That repository is a lure, not an exploit. It appeared on GitHub at 20:34 UTC on November 24, seven hours after the CVE, calls itself a "PoC skeleton," states that the execution chain is "intentionally omitted," writes a few placeholder bytes to a file, and asks readers to email an address for "the full weaponized research pipeline." It does nothing to a server. Do not treat its existence as a public exploit, and do not send anyone money or credentials for the "full" version.
CISA KEV: not listed as of the catalog release we read at 14:22 UTC on November 25, even though the vendor advisory itself marks the flaw as exploited.
Package checks: our package checker covers npm, PyPI, RubyGems, Packagist and GitHub Actions, not Hex, so the library advice above comes from the OSV and Erlang Ecosystem Foundation records, not from our deny-list.
Coverage: we had no earlier post on this incident. This is coverage of the Hex team's disclosure, not a detection of ours.
How we know
Primary source read in full: "Security incident on hex.pm," hex.pm/blog/security-incident-on-hexpm, by Peter Ullrich, Jonatan Männchen and Eric Meadows-Jönsson, November 24, 2026. Every quote about the timeline, the integrity checks, the credentials and the user actions is from that post.
Advisory: GitHub Security Advisory GHSA-9pmm-hf4r-27pg for hexpm/hexpm (CVE-2026-129514, CWE-502, CVSS 4.0 score 10.0, published November 24 13:48 UTC, analysts credited: Jonatan Männchen and Peter Ullrich), and the matching OSV record EEF-CVE-2026-129514.
Related advisories: OSV records EEF-CVE-2026-124283 (ash, fixed 3.38.0; credited to Jonatan Männchen of the Erlang Ecosystem Foundation, fix by Zach Daniel), EEF-CVE-2026-133555 (db_connection, fixed 2.10.3; fix by José Valim) and EEF-CVE-2026-130411 (flop; found by Jonatan Männchen and Wojtek Mach), plus the db_connection GitHub advisory GHSA-gmmq-fw75-wq46.
Hex documentation: the registry specification (signing of all registry resources; inner and outer checksums), the Hex FAQ (lockfile checksums), and the Hex client source for the mirror and unsafe settings and their environment variables.
Forum: Peter Ullrich's thread "Hex.pm security incident" on the Elixir Forum, for the "this does not apply to you" answer.
Press: The Hacker News, November 25, which tracks the Hex report closely. One source, not two.
Not verified: who the attacker is or their addresses (not published); whether any database row was read (Hex cannot tell); the release date and details of the new signing system; the identity of the person who emailed the 19:07 report (Hex does not name them).
Read next, on keeping poisoned dependencies out of a build: Your pipeline can now block 225,000 malicious packages. Here's that, and every other way we plug into your stack.
Every indicator in this post is in the feed. Free.
1.58M+ IOCs, STIX 2.1 / TAXII, 88% novel vs ThreatFox, exploited-CVE leads ahead of CISA. No credit card — a free API key in 30 seconds, and you can audit every claim above against the live endpoints.



Comments