Summary
Hex.pm, the package registry used by the Elixir, Erlang and Gleam ecosystems, was breached on November 23 through a previously unknown remote-code-execution flaw. An unauthenticated attacker sent 69 exploit requests during a 13-minute window and ran operating-system commands on six production web servers before the service blocked the traffic and replaced every server with a patched build.[1][2]
The vulnerability, CVE-2026-129514, carries the maximum CVSS 4.0 score of 10.0. It had been present in Hex.pm's request-decoding path since February 2016. A specially constructed Erlang term could pass through a decoder intended to reject executable values, masquerade as trusted Elixir structures, and eventually turn error reporting into command execution before a request reached routing or authentication.[1][2]
Hex.pm found no evidence that packages, registry files or database records were changed. That is the most important result for downstream developers. It is not the same as proving that nothing was read. Database reads, environment-variable reads, shell commands and some direct storage access were not logged, so maintainers cannot rule out exposure of email addresses, password hashes, two-factor secrets, private packages or infrastructure credentials.[1]
The incident lasted minutes. The trust-recovery work will take longer.
A Package Registry Is More Than a Website
Hex.pm is where developers publish and retrieve packages for the BEAM ecosystem. That makes its integrity part of the build process for applications written in Elixir, Erlang and Gleam. A compromised package registry is dangerous even when the initial intrusion reaches only web servers: those servers may hold database credentials, storage access, signing material and the authority to serve artifacts that automated build systems trust.
The attacker reached exactly that layer. According to Hex.pm's incident report, the first exploit request arrived at 18:16:00 UTC. A file created by an injected command appeared on a server 3 milliseconds after one request at 18:16:46. The team began responding within minutes, added a firewall rule at 18:27, and had all web, worker and job servers running the patched build by 18:31.[1]
Six web servers executed commands. Three were brought online during a restart at 18:28 while the vulnerable build was still active, illustrating an uncomfortable incident-response lesson: scaling or replacing infrastructure can reproduce the vulnerability unless the deployment artifact is fixed first.[1]
By 18:33:48, the firewall was denying every request from the identified attacking address. Hex.pm received an independent report describing the same vulnerability at 19:07, after the exploit traffic had ended.[1]
How “Safe” Deserialization Became Code Execution
The entry point was Hex.pm's parser for requests using the application/vnd.hex+erlang content type. The parser called Plug.Crypto.non_executable_binary_to_term/2 with its safe option. That function rejected functions and new atoms, but it still accepted maps containing a __struct__ key.[1][2]
In Elixir, a struct is represented as a map whose __struct__ field identifies a module. The attacker could therefore submit data that the runtime treated as an instance of an already loaded structure. Because the parser ran in the endpoint before routing and authentication, an unauthenticated POST request to any route could reach it.[2]
The exploit then turned ordinary framework behavior into a chain:
- The crafted value became the request body parameters.
- Method-override handling tried to read a field from the fake structure and raised an error.
- Error reporting inspected the attacker-controlled value.
- Elixir protocol dispatch selected code based on the fake structure's module.
- A chain through Ecto and DBConnection reached a logging callback represented by a module, function and argument tuple supplied in the request.
- The server applied that tuple and executed an operating-system command as the BEAM process user.[1][2]
No single step looked like an explicit request to execute a shell command. The exploit assembled that outcome from permissive deserialization, protocol dispatch, error inspection and a configurable callback. This is why the CVE received a 10.0 score: exploitation was remote, unauthenticated, low-complexity and required no user interaction.[2][3]
The immediate fix is deliberately narrow. Hex.pm now rejects any decoded term containing a map with a __struct__ key, returning an HTTP 400 response before the value can enter request parameters. The patched code was deployed to every Hex.pm server on November 23.[1][2]
The maintainers are also pursuing defense-in-depth changes in Plug Crypto, Plug, Ecto and DBConnection. Those changes are intended to prevent the same class of attack at several layers rather than trusting one decoder check to carry the entire security boundary.[1]
What Hex.pm Could Verify
Hex.pm's investigation was unusually specific about what the available evidence did and did not prove.
The team restored a database copy from 18:13:59, shortly before the first malicious request, and compared every table with the live database. Every row added, modified or removed could be explained by audit logs, background jobs or the incident response. Investigators found no unexpected changes to tables, functions, roles or permissions.[1]
They also examined package and registry storage. All 23 releases published during the incident matched legitimate publish or stage events. All 62 package files written after 18:00 matched database checksums, as did all 186 registry files. No older release changed.[1]
Those checks provide meaningful evidence that the attacker did not poison the public package supply chain during the observed window. They do not establish that confidential information remained unread. The compromised server process could access environment variables containing the database URL, storage credentials and registry-signing material. Reads from the database and direct reads from cloud storage were not comprehensively logged.[1][2]
Hex.pm therefore rotated storage, CDN, email and database credentials, along with keys used to sign sessions and access tokens. That operation logged users out of the website and command-line clients. By the morning of November 24, every credential the attacker could have read had been replaced except the registry-signing key and a small number of low-impact secrets.[1]
The registry-signing key is the difficult part. Hex.pm is building a new signing system that supports key rotation and plans corresponding client releases. Until those clients are available, the project advises developers to fetch packages only from repo.hex.pm and not from third-party mirrors.[1]
What Hex.pm Users Should Do
Hex.pm is asking account holders to change their passwords and reset two-factor authentication. Resetting 2FA creates a new secret and new recovery codes. Users must also sign back into their Hex clients because the session and access-token signing keys were rotated.[1]
When the updated Hex client with the new registry-signing design becomes available, developers should install it promptly. Elixir users can update Hex with mix local.hex --force; teams using rebar3 or Gleam should update the corresponding tooling as directed by the project.[1]
Organizations should also treat email associated with Hex.pm as potentially exposed. That raises the value of phishing messages that imitate package-security notices or password-reset requests. Links in Hex-related email should be checked carefully to confirm that they lead to hex.pm.[1]
Hex.pm says API keys do not need to be rotated solely because their hashes may have been exposed. The service stores randomly generated 128-bit API keys as HMAC-SHA256 hashes, which it considers infeasible to reverse. Passwords use bcrypt, but weak passwords remain vulnerable to offline guessing, which is why the password change is still recommended.[1]
Teams operating a self-hosted copy of the Hex.pm registry code have a separate responsibility: deploy the fix represented by commit 379b0a2 or a later patched build. The flaw is in the registry server, not in an ordinary developer's local Hex client.[2][3]
The Larger Supply-Chain Lesson
This incident did not become a confirmed package-poisoning event. That outcome came from rapid containment, short-lived production servers, available audit data and a detailed artifact comparison. It should not be mistaken for a low-impact vulnerability.
The attacker gained command execution on infrastructure positioned directly beside a language ecosystem's package-distribution trust boundary. The same process could read credentials for the database, storage and signing systems. The absence of unauthorized package modifications is a verified result of this incident, not a property that made the exploit inherently safe.[1][2]
The vulnerability also survived for more than a decade inside code that explicitly used a “safe” decoding mode. The dangerous behavior emerged only when several legitimate abstractions interacted: serialized structures, protocol dispatch, exception inspection and database logging. Security reviews that stop at the decoder's function name can miss the behavior of the complete execution path.
For registry operators, the operational priorities are clear:
- Treat package storage, metadata databases and signing systems as separate trust zones.
- Ensure registry-signing keys can be rotated without an emergency client redesign.
- Log sensitive reads where practical, not only writes.
- Test whether autoscaling or replacement nodes can reintroduce a vulnerable build during containment.
- Maintain an independent way to compare stored artifacts with authoritative metadata and audit records.
- Assume that error formatting and observability code can process attacker-controlled objects.
Hex.pm responded quickly and published a candid account of its evidentiary limits. The result is reassuring where the evidence is strong: no unauthorized package, registry or database modification was found. The unresolved risk is confidentiality. Because the compromised servers had access to valuable secrets and some reads were invisible to logging, users and operators still need to complete the credential, 2FA and client updates rather than treating the clean artifact comparison as the end of the incident.
Sources
- Hex.pm, “Security incident on hex.pm,” November 24, 2026.
- GitHub Security Advisory GHSA-9pmm-hf4r-27pg, “Unauthenticated remote code execution through struct values in Erlang term request bodies,” November 24, 2026.
- Erlang Ecosystem Foundation CNA, CVE-2026-129514.
- The Hacker News, “Hackers Exploited CVSS 10.0 Hex.pm RCE Flaw to Compromise 6 Package Registry Servers,” November 25, 2026.
