The Daily Byte
Breaking
Welcome to The Daily Byte — real stories from across Pakistan.
Sunday, 29 November 2026 · Pakistan

The Daily Byte

Stories from Pakistan that deserve to be heard

CVE-2026-129514: Hex.pm Hack Hits Six Servers

By The Daily Byte ·27 Nov 2026 ·4 min read
Computer code on a screen, representing the Hex.pm CVE-2026-129514 remote code execution flaw

An attacker ran operating-system commands on six production servers of Hex.pm, the package registry that Elixir and Erlang developers use to fetch their dependencies, by exploiting a flaw that had sat in the registry's code for more than ten years. The flaw, tracked as CVE-2026-129514, carries the maximum CVSS score of 10.0.

Hex.pm disclosed the incident on 24 November 2026. The attack took place the previous day, 23 November, between 18:16 and 18:29 UTC. In those thirteen minutes the attacker sent 69 malicious requests from two addresses, and commands ran on six web servers. In one case a file created by the exploit appeared on a server just three milliseconds after the request arrived. The team had a patched build running on every server by 18:31 UTC, about fifteen minutes after the first malicious request, after adding a firewall rule at 18:27 to block the attacker's traffic.

A decade-old flaw in the request parser

The flaw was in the code that reads request bodies sent in Erlang term format. Hex.pm decoded unauthenticated request bodies with a function meant to reject dangerous values, Plug.Crypto.non_executable_binary_to_term/2, but the check allowed struct values through. An Elixir struct is simply a map with a __struct__ key naming a module, so the attacker could send a value the runtime treated as a real struct, with every field set to their choice. Because the endpoint runs this parser before routing and authentication, any unauthenticated POST with the right content type reached it on every route.

From there the attacker chained the fake struct through several layers of the application. It passed through Plug.MethodOverride, then into error reporting, where the inspect protocol ran code from the module named in the struct. That led through Ecto.Query.DynamicExpr and into DBConnection.Stream, whose log option was a module, function and arguments tuple taken from the request. Running that tuple gave access to functions in loaded libraries and the standard library, which led to operating-system commands running as the BEAM's user, the account the Erlang virtual machine runs under.

The safety check that would have stopped this was removed from the code on 23 February 2016, which is why the flaw is dated to that year. The Hex.pm team says exploitation before 23 November has not been established. The team also found the same class of flaw in Ash, another Elixir library, where crafted structs in client-supplied cursors could lead to command execution or SQL injection. That flaw is tracked as CVE-2026-124283 and was fixed in Ash 3.38.0 on 24 November.

No packages changed, but data reads cannot be ruled out

The good news for developers is that no packages were changed. Hex.pm compared every row of every table in its database against a snapshot taken at 18:13:59, two minutes before the first exploit request, and found no unexpected change. All 23 releases published during the incident matched audit-log entries, and all 62 package files and 186 registry files written since 18:00 matched the checksums in the database.

What cannot be ruled out is that the attacker read data. Database reads are not logged, so Hex.pm says it cannot rule out access to email addresses, password hashes, API key hashes, two-factor authentication secrets, sessions and audit logs, as well as the contents of private packages. Six servers were hit partly because a restart at 18:28 brought up three new servers still running the vulnerable build, halfway through the attack.

What users should do now

The team rotated the credentials its servers use, including storage, content delivery, email and database credentials and the keys that sign sessions and access tokens, which logged everyone out of hex.pm and Hex clients. It is building a new registry signing system that supports key rotation, with new Hex client releases due in the coming days, and until then users should fetch packages only from repo.hex.pm and not trust third-party mirrors. The incident was reported to the Swedish data protection authority, to CISA in the United States and to ENISA in the European Union.

Hex.pm users should change their password and reset two-factor authentication now. Organisations that run their own copy of the hexpm server are affected until they deploy fix commit 379b0a2, which makes the decoder reject any term containing a map with a __struct__ key. The Hex client itself is not affected. The team's investigation also found that the attacker had repeatedly downloaded hex.pm's own dependencies since 19 November, which suggests they built a local copy of the service to test the attack against before using it for real.