Vulnerabilities and exploitation
Hex.pm confirms attackers ran commands on six of its servers via CVSS 10.0 flaw
An unauthenticated remote code execution flaw in the Elixir and Erlang package registry was exploited on 23 November 2026. Hex.pm says it patched affected servers within 15 minutes.
An attacker used a critical flaw in hex.pm, the package registry for Elixir and Erlang projects, to run arbitrary commands on six production servers, The Hacker News reported. The registry's maintainers detected the malicious request and patched every affected server within 15 minutes, according to the same report.
The flaw, CVE-2026-129514, carries a CVSS score of 10.0, and the registry's own security advisory confirms it was actively exploited against hex.pm on 23 November 2026, the day the fix shipped. Any POST request to any route could reach the vulnerable code without authentication, and a successful exploit ended in an operating system command running as the user of the BEAM process, BEAM being the virtual machine that Erlang and Elixir code runs on. From there, the advisory notes, an attacker can read the application environment: the database URL, storage credentials, and the registry signing key, the key that vouches for the integrity of the packages the registry serves.
What the attacker did with that access has not been detailed. The advisory does not describe post-exploitation activity, and no incident report has been published saying whether any package, credential or signing key was touched. The 15-minute response time narrows the window considerably, but it does not by itself answer the question.
The flaw was not new. The affected range starts on 23 February 2016, the date a safety check was removed from the request decoder, as the git history of that decoder shows. The vulnerability therefore sat in the registry for nine years and nine months, to the day.
What to do now
The hex.pm service itself is hosted and already patched, so there is no client-side update to install for the registry flaw. The steps below apply to anyone running the hexpm software or shipping Elixir applications built on the affected libraries.
- If you run your own instance of hexpm, update to a build that includes commit
379b0a29bcc95164249f38ad7d772a37a8ff9533. Treat anything older as vulnerable, including every version back to February 2016. - Update the
db_connectionlibrary to 2.10.3. Versions from 1.1.0 up to but not including 2.10.3 carry CVE-2026-133555, a related high-severity issue that lets code run via the:logoption of a forgedDBConnection.StreamorDBConnection.PrepareStreamstruct. - Audit your own applications for the same pattern: any endpoint that decodes untrusted input into Erlang terms, for example with
:erlang.binary_to_term/2orPlug.Crypto.non_executable_binary_to_term/2, and then builds structs from the result. The "non-executable" variant refuses functions and new atoms, but it does not stop a map carrying a__struct__key, which is the gap that was exploited here. - Reject decoded terms that contain a
__struct__key outright, as the hexpm fix does, rather than trying to allow-list which structs are safe to forge. - If you host a service that holds secrets in its application environment, check whether a single process compromise would hand over signing keys and storage credentials, and whether those credentials can be rotated quickly.
Technical details
CVE-2026-129514 is a deserialization of untrusted data issue (CWE-502) in HexpmWeb.ErlangFormat.decode/1, the function that handles request bodies with the content type application/vnd.hex+erlang. It decoded them with Plug.Crypto.non_executable_binary_to_term/2, which permits maps containing a __struct__ key to pass through. That allows struct forgery: an attacker supplies a value that the application then treats as a trusted internal data structure.
The advisory describes the chain that turned that into command execution. Plug.MethodOverride was used to get the request to the right place, the Inspect implementation of Ecto.Query.DynamicExpr provided the gadget, and a forged DBConnection.Stream struct carried it to an apply/3 call with attacker-controlled module, function and arguments. apply/3 calls whatever it is told to call, which at that point means an operating system command running as the BEAM process user.
The parser ran ahead of the router and authentication. There was no need to find an exposed endpoint or hold valid credentials: any POST to any route reached the decoder.
Affected versions run from 23 February 2016 until the patch on 23 November 2026, which corresponds to hexpm commit 379b0a29bcc95164249f38ad7d772a37a8ff9533. The fix makes decode/1 return an error when any map in the decoded term contains a __struct__ key, so such requests now get a 400 response. The vulnerability was credited to maennchen, with ericmj and maennchen developing the remediation and PJUllrich listed as an analyst.
The related library issue, CVE-2026-133555, carries CVSS 8.9 and affects db_connection versions greater than or equal to 1.1.0 and less than 2.10.3. It is a CWE-470 issue, use of externally controlled input to select a class or code, and it is not exploitable in db_connection on its own: it needs a downstream component that decodes untrusted input, for example via :erlang.binary_to_term/2, and builds structs from it, which is precisely what hex.pm's Erlang term parser did. The advisory explains why the record exists at all, stating that "This record exists because the struct was used in attacks on such components." The patched version is 2.10.3.
The db_connection advisory also cross-references CVE-2026-124283, which allows code execution and SQL injection through struct-wrapped values in a forged Ash keyset pagination cursor, alongside the hex.pm flaw. The common thread is one mistake in three places: trusting that a decoded map which claims to be a struct really is one.
No indicators of compromise have been published, and no attacker has been named. Whether packages, credentials or the registry signing key were affected in the hex.pm incident remains unstated.
Share this article
What changed
- : Further sources have confirmed the main details.
- : Confirmed that the attacker ran commands on six hex.pm production servers and that the team patched them within 15 minutes of spotting the malicious request.