Mastodon Mastodon Mastodon Mastodon

CVE-2026-129514 vulnerability (CVSS 10.0) in Hex.pm led to compromise of six package registry servers

Photo of author

CyberSecureFox Editorial Team

Published:

On 23 November 2026, an attacker executed operating system commands on six production Hex.pm servers — the main package registry for the Elixir and Erlang ecosystems. The attack exploited vulnerability CVE-2026-129514 with the maximum CVSS 10.0 score, classified as CWE-502 (deserialization of untrusted data). The vulnerable code had existed in the codebase since February 2016 — more than ten years. According to the Hex.pm team, no package modifications were found, but they cannot rule out reading of the database with email addresses, password hashes, and two-factor authentication secrets. All hex.pm account owners should immediately change their password and reconfigure two-factor authentication.

Vulnerability mechanism and exploit chain

The vulnerability was in the Hex.pm server-side parser that processed request bodies with the application/vnd.hex+erlang format. According to the incident report, this parser ran before routing and authentication, which meant that an unauthenticated POST request with the corresponding content type to any path on the site would hit the vulnerable code.

The parser used a decoding function with the [:safe] flag, which blocked dangerous terms such as functions but accepted maps with the __struct__ key. This allowed the request body to be represented as an arbitrary Elixir struct loaded into the application. By itself, the forged struct did not execute code — it triggered an error. However, the error reporting system (Sentry) inspected the struct, and through the Ecto and DBConnection libraries this inspection led to the invocation of an arbitrary function with the privileges of the registry service account.

The safeguard that would have prevented such substitution was removed from the code on 23 February 2016. According to the security advisory, the vulnerability affected Hex.pm from that date until 23 November 2026. The fixing commit rejects any term containing a map with the __struct__ key, returning a 400 response.

Attack timeline and scope

According to the Hex.pm team, between 18:16 and 18:29 UTC on 23 November, 69 malicious requests were received from two IP addresses. Files created by the exploit appeared on six web servers — in one case, three milliseconds after the request. Three of the six servers were affected because a restart during the attack brought up machines that were still running the vulnerable build. By 18:31 UTC all servers had been switched to the fixed version — the response took about 15 minutes.

Activity from the two attacking addresses, observed since the end of the previous week, in the team’s opinion indicates that the attacker had first built a local copy of Hex.pm for testing. No independent confirmation of these data has been found — all information about the scope of the attack is based on the investigation by the Hex.pm team itself. Attribution of the attack has not been established: no official source links the incident to a known threat actor or campaign.

What has and has not been established

The Hex.pm team compared every database table with a copy made two minutes before the first exploit request. All 23 releases published during the attack match the audit log, not a single previously published package was changed, and the package and registry files match the database records.

However, reading of the database, execution of shell commands, access to environment variables, and direct reading of the file storage were not logged. Therefore, the team cannot rule out that the attacker gained access to data in the database: email addresses, password hashes (bcrypt), API key hashes (HMAC-SHA256), two-factor authentication secrets, session data, as well as private packages. No residual backdoors or new accounts or cloud keys were found in the audit logs.

Comparative analysis of the attack surface

It is important to distinguish between the scope of the Hex.pm vulnerability and related disclosures in ecosystem libraries. The vulnerable Hex.pm parser ran before authentication on every route — this meant a maximally broad attack surface with no prerequisites on the attacker’s side. In contrast, the related vulnerabilities in Ash and Flop require specific conditions: a client pagination cursor, certain types of sorting, and an unconfigured signing secret (Ash), or cursor pagination being enabled (Flop). The vulnerability in db_connection is not exploitable on its own at all — it requires a separate component that performs unsafe deserialization.

Related vulnerabilities in the Elixir ecosystem

Alongside the incident, vulnerabilities were disclosed in three libraries related to processing structs from untrusted data. These are separate disclosures and are not a continuation of the attack on Hex.pm:

  • CVE-2026-124283 (Ash, CVSS 8.9, CWE-89/CWE-502) — affects versions 3.31.3 to 3.38.0. Exploitation requires cursor pagination with a client-side cursor and an unconfigured signing secret. Fixed in version 3.38.0.
  • CVE-2026-130411 (Flop, CVSS 9.2, CWE-502) — affects versions 0.8.0–0.26.6, 0.27.0–0.27.2, 0.28.0, 0.29.0–0.29.1. The temporary workaround is to disable cursor pagination.
  • CVE-2026-133555 (db_connection, CVSS 8.9, CWE-470) — affects versions 1.1.0 to 2.10.3. According to the DBConnection advisory, it is not exploitable on its own.

What needs to be done

All users with a hex.pm account were forcibly logged out after the session and access token signing keys were rotated. The Hex.pm team recommends the following actions:

  1. Change your hex.pm password. Passwords are hashed with bcrypt, which slows down cracking but does not rule it out for weak passwords.
  2. Reconfigure two-factor authentication: create a new authenticator entry and save new recovery codes.
  3. Re-authenticate in the client with mix hex.user auth (Elixir) or rebar3 hex user auth (Erlang).
  4. Update the Hex client when the next release with the new registry signing system comes out.
  5. Until the new client is released, obtain packages only from repo.hex.pm, avoiding third-party mirrors — the registry signing key has not yet been replaced.
  6. Be cautious with phishing emails: compromised email addresses may be used for targeted phishing.

API keys do not need to be rotated: they are random 128-bit values stored only as HMAC-SHA256 hashes. Developers without a hex.pm account who use only public packages are not affected. Organizations running their own Hex registry instances should deploy the server-side patch — the vulnerability is in the hexpm server code, not in the client.

The Hex.pm incident illustrates a concrete risk: a parser that processes untrusted data before authentication turns every application route into an entry point for remote code execution. Hex.pm account owners should carry out all the listed steps now, and Elixir application developers should update Ash to 3.38.0, Flop to the current fixed versions, and db_connection to 2.10.3, even if these libraries were not involved in this particular attack.


CyberSecureFox Editorial Team

The CyberSecureFox Editorial Team covers cybersecurity news, vulnerabilities, malware campaigns, ransomware activity, AI security, cloud security, and vendor security advisories. Articles are prepared using official advisories, CVE/NVD data, CISA alerts, vendor publications, and public research reports. Content is reviewed before publication and updated when new information becomes available.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.