Exploits

Hex.pm Breach: CVSS 10.0 Flaw Hit Production

Eng. Donya Bino Published  ·  9 min read

Hex.pm

The first malicious request arrived Monday. By the time the Hex.pm team had every server on a patched build, roughly 15 minutes had passed.

That is the part worth starting with, because it is genuinely fast. The part worth continuing with is that the flaw had been in the registry's code since February 2016.

Hex.pm is the package registry Elixir and Erlang developers fetch dependencies from. An attacker ran operating system commands on six of its production servers.

What the Flaw Was

CVE-2026-129514 scores 10.0, the maximum.

It sat in the parser hex.pm used to read request bodies sent in an Erlang data format. That parser ran before routing and authentication, which means an unauthenticated POST request to any address on the site could reach it.

Detail

Value

CVE

CVE-2026-129514

CVSS

10.0

Component

Erlang data format request body parser

Authentication required

None

Introduced

February 23, 2016

Patched

Monday, all servers by 18:31 UTC

The decoding function was designed to be safe. It blocked dangerous terms such as functions. But it accepted maps with a __struct__ key, which allowed a request body to pose as any Elixir struct the application had already loaded.

The safety check that would have stopped this was removed from the code on February 23, 2016. That is the source of the flaw's age.

The Exploit Chain

A crafted struct did not run anything by itself. That is the detail that makes this chain worth understanding.

It caused an error. Then the error reporting code inspected the struct. That inspection, routed through the Ecto and DBConnection database libraries, led to a point where the server called a function of the attacker's choice.

That function ran operating system commands with the permissions of the registry's service account.

Read the sequence again. The attacker did not need to defeat a validation check. They needed to make the application fail in a way that triggered a handler capable of calling into user-controlled code.

The Response Window

Load balancer logs recorded 69 exploit requests between 18:16 and 18:29 UTC on Monday, all from two addresses.

Files created by the exploit appeared on six web servers. In one case, a file appeared 3 milliseconds after the request.

Three of those servers joined mid-attack, when a restart brought up machines still on the vulnerable build. That is a detail worth sitting with. A restart during an incident reverted three hosts to a vulnerable state, and they were compromised before they could be patched again.

The fix commit makes the decoder reject any term containing a map with a __struct__ key. Every hex.pm server was running it by 18:31 UTC.

What Was Not Changed

The package audit was thorough, and the findings are reassuring on that specific question.

The team compared every database table against a copy taken two minutes before the first exploit request, and traced each difference to normal activity.

The 23 releases published during the attack all match the audit log. No older release was changed. The package and registry files written that evening match the database records.

No sign that any package was tampered with. That is the outcome that would have turned this into a supply chain incident, and it did not happen.

What Cannot Be Ruled Out

Database reads, shell commands, environment variables, and direct reads from file storage were not logged.

For that reason, the team states plainly that it cannot rule out that the attacker accessed data stored in the database.

That database holds email addresses, password hashes, API key hashes, two-factor authentication secrets, and session data. Private packages could also have been read without leaving a trace.

The checks found no leftover shells, no new accounts, and no new cloud keys in the audit logs.

Who was behind the attack is unknown. Activity from the two addresses going back to late last week suggests the attacker built a local copy of hex.pm to test against.

The Registry Signing Key

This is the item that has not been resolved, and it is the one to track.

The registry signing key had not yet been replaced at the time of the report, and it was among the credentials the attacker could have read.

Until a new client ships, the advice is to fetch packages only from repo.hex.pm and avoid third-party mirrors.

A registry signing key is what allows a client to verify that a package came from the registry. Its compromise does not mean packages were altered. It means the mechanism that would prove they were not altered is weakened.

What Every Hex User Must Do

Everyone with a hex.pm account has been logged out, because the maintainers replaced the keys that sign sessions and access tokens.

  • Change your hex.pm password.
  • Reset two-factor authentication by setting up a new authenticator entry, and store the new recovery codes.
  • Log back in to the client with mix hex.user auth, or rebar3 hex user auth for Erlang projects.
  • Update the Hex client when the next release ships, expected within days, with a new registry signing system.
  • Watch for phishing. Exposed email addresses may be misused. Check that links in any email about Hex go to hex.pm.

What You Do Not Need to Do

API keys do not need to be replaced. They are random 128-bit values stored only as HMAC-SHA256 hashes, which the team says cannot realistically be brute-forced.

Passwords are hashed with bcrypt. That slows guessing but does not stop it for weak passwords, which is why changing them still matters.

If You Never Had an Account

Developers who never created a hex.pm account and only fetch public packages have nothing to reset, according to maintainer Peter Ullrich.

Those who signed up with GitHub should still log back in to their clients, and reset two-factor authentication if they enabled it.

The Related Library Flaws

Alongside the incident, maintainers of three widely used Elixir libraries disclosed flaws of their own involving structs built from untrusted data. These are separate disclosures, not further attacks on Hex.pm.

Library

CVE

Affected

Fixed

ash

CVE-2026-124283

3.31.3 up to 3.38.0

3.38.0

db_connection

CVE-2026-133555

1.1.0 up to 2.10.3

2.10.3

flop

CVE-2026-130411

From 0.8.0, each branch before its fix

0.26.7, 0.27.3, 0.28.1, 0.29.2

Each needs its own conditions. The Ash flaw requires keyset pagination with a client-supplied cursor, certain sort field types, and a signing secret left at its unset default.

The DBConnection flaw is not exploitable in DBConnection alone, because another component must first decode untrusted data into structs. The Flop flaw has similar conditions around pagination cursors.

The Self-Hosted Case

The exploited flaw sits in the hexpm server code, not in the Hex client. Organizations that run their own copy of the registry are affected until they deploy the patch.

What This Incident Teaches

Three things stand out.

A safety check removed in 2016 for reasons nobody documented became a 10.0 in 2026. Code that stops being dangerous does not stop existing.

The response was fast. Fifteen minutes from first request to full patch coverage is close to the practical floor for this kind of incident.

And the restart during the attack reverted three hosts to a vulnerable state. That is an operational lesson independent of the flaw itself. During an active exploitation window, restarting a host is not a neutral action.

FAQ

What is CVE-2026-129514?

A critical (10.0) flaw in the parser Hex.pm used to read Erlang-format request bodies. It ran before authentication, and it accepted maps with a __struct__ key, allowing a request body to pose as any loaded Elixir struct.

What did the attacker actually achieve?

Operating system command execution on six production servers, with the permissions of the registry's service account.

How did the flaw run code if the struct did nothing by itself?

It caused an error. The error reporting code inspected the struct, and that inspection through the Ecto and DBConnection libraries reached a point where the server called a function of the attacker's choice.

How long was the flaw present?

Since February 23, 2016, when a safety check was removed from the code.

Were any packages changed?

No. The team compared every database table against a copy taken two minutes before the first request, traced each difference to normal activity, and confirmed that all 23 releases published during the attack match the audit log.

What data might have been accessed?

The team cannot rule out database access. That database holds email addresses, password hashes, API key hashes, two-factor authentication secrets, and session data. Private packages could also have been read.

Do I need to change my API key?

No. API keys are random 128-bit values stored only as HMAC-SHA256 hashes and cannot realistically be brute-forced.

What do I need to reset?

Your password and your two-factor authentication setup. Everyone has been logged out because session and access token signing keys were replaced.

Has the registry signing key been replaced?

Not yet, at the time of the report. Until a new client ships, fetch packages only from repo.hex.pm and avoid third-party mirrors.

I only fetch public packages and never made an account. Do I need to do anything?

No. Maintainer Peter Ullrich confirmed that developers without a hex.pm account have nothing to reset.

What about the related library flaws?

ash, db_connection, and flop each disclosed separate struct-related flaws with their own conditions and their own fixed versions. They are not further attacks on Hex.pm.

Is the Hex client affected?

No. The flaw is in the hexpm server code. Organizations running their own copy of the registry need to deploy the patch.

Who was behind the attack?

Unknown. Activity from the two addresses going back to late last week suggests the attacker built a local copy of hex.pm to test against.

What happened with the three servers that joined mid-attack?

A restart brought up machines still on the vulnerable build, and they were compromised before being patched again. That is why restarting during an active exploitation window is not neutral.

What should I watch for now?

Phishing against exposed email addresses. Verify that any email about Hex points to hex.pm before clicking.

Source: The Hacker News
Professional Services

Explore Our Cybersecurity Services

Our insights are backed by hands-on service delivery. If your business needs professional cybersecurity support, our UK-based specialists are ready to help.

© 2016 – 2026 Red Secure Tech Ltd. Registered in England and Wales — Company No: 15581067