JupiteX Get the app
Science & Technology27 Nov 2026 · about 7 min

Hackers Exploited CVSS 10.0 Hex.pm RCE Flaw to Compromise 6 Package Registry Servers

The brief

The attacker did not need to log in: Hex.pm parsed request bodies before routing requests or checking authentication. That meant an unauthenticated POST request to any address on the site could reach the vulnerable parser. The flaw had been present since February 2016. The parser read request bodies in an Erlang data format. It blocked some dangerous terms but accepted maps containing a struct key, allowing a body to pose as an Elixir struct loaded by the application. The crafted struct caused an error; error-reporting code then inspected it, and work involving the Ecto and DBConnection database libraries reached a call to a function chosen by the attacker. That function ran operating-system commands with the permissions of Hex.pm’s service account. Files created by the exploit appeared on six web servers, and logs recorded 69 exploit requests. The team patched every server within about 15 minutes of the first malicious request. It could not rule out access to database data.

01

How did the attacker use an unauthenticated request to run operating system commands on Hex.pm servers?

The attacker did not need to log in: Hex.pm parsed request bodies before routing requests or checking authentication. That meant an unauthenticated POST request to any address on the site could reach the vulnerable parser. The flaw had been present since February 2016.

The parser read request bodies in an Erlang data format. It blocked some dangerous terms but accepted maps containing a __struct__ key, allowing a body to pose as an Elixir struct loaded by the application. The crafted struct caused an error; error-reporting code then inspected it, and work involving the Ecto and DBConnection database libraries reached a call to a function chosen by the attacker.

That function ran operating-system commands with the permissions of Hex.pm’s service account. Files created by the exploit appeared on six web servers, and logs recorded 69 exploit requests. The team patched every server within about 15 minutes of the first malicious request. It could not rule out access to database data.

02

What does remote code execution mean, and what access did it give the attacker on the servers?

Remote code execution, often shortened to RCE, is a security flaw that lets someone cause a computer to run code or commands from afar. It matters because the attacker may be able to make the affected server do more than process an ordinary request. The precise reach depends on the permissions of the program that runs the commands.

At Hex.pm, a crafted request exploited a parser and an error-reporting path. That path reached a function selected by the attacker, which ran operating-system commands. The article says those commands had the permissions of the registry’s service account. It does not say the attacker gained administrator or root privileges, so those should not be assumed.

The exploit affected six production web servers, where files created by it were found. The team found no leftover shells, but it could not rule out that the attacker read database data, including account details or private packages. Every server was patched within about 15 minutes of the first malicious request. The incident shows why a server’s account permissions can limit the impact of a flaw.

03

How many servers were affected, and how many exploit requests did the logs record?

The incident involved six production web servers: files created by the exploit appeared on all six. That count describes servers where investigators found exploit-created files, rather than a confirmed count of machines from which data was taken. The report does not establish that the attacker read data from any particular server.

Load-balancer logs recorded 69 exploit requests between 18:16 and 18:29 UTC on Monday. The requests came from two addresses. In one case, a file appeared on a server just three milliseconds after the request. Three of the six servers joined during the attack after a restart brought up machines still running the vulnerable build.

The team said it had every server on a patched build by 18:31 UTC, about 15 minutes after the first malicious request. It found no leftover shells and no new accounts or cloud keys in audit logs. Those checks do not settle whether database data was read: such reads were not logged, so the team said access to stored data could not be ruled out.

04

What did investigators confirm about package changes, and what account or private-package data might still have been accessed?

The team checked whether the attacker changed Hex.pm packages. It compared every database table with a copy made two minutes before the first exploit request and traced each difference to normal activity. The 23 releases published during the attack matched the audit log, no older release had been changed, and package and registry files written that evening matched database records.

That provides evidence against package tampering, but it does not show whether information was taken. Database reads, shell commands, environment variables, and direct reads from file storage were not logged. The team therefore could not rule out that the attacker accessed stored data.

The database held email addresses, password hashes, API key hashes, two-factor authentication secrets, and session data. Private packages might also have been read without leaving a trace. The team found no new accounts or cloud keys in audit logs and said no packages appeared changed. Account holders were advised to change passwords, reset two-factor authentication, and watch for phishing.

05

How did a crafted map posing as an Elixir struct lead error-reporting code to run an attacker-chosen function?

A request body could not run commands just by claiming to be a struct. The key weakness was that Hex.pm’s decoder accepted a map containing __struct__, so the data could pose as an Elixir struct the application had loaded. The decoder was meant to be safe and blocked other dangerous terms, but this check was missing.

The crafted struct caused an error. Hex.pm’s error-reporting code then inspected the struct, and that inspection passed through the Ecto and DBConnection database libraries. The path eventually reached a point where the server called a function chosen by the attacker. That function ran operating-system commands under the registry service account’s permissions.

The flaw was in the code since February 23, 2016; the article says exploitation before Monday has not been established. The fix makes the decoder reject any term containing a map with a __struct__ key. Every server was running the fix by 18:31 UTC on Monday. The team’s checks found no package changes, but could not rule out data access.

06

Why is it risky for a server to parse untrusted request data before checking who sent it?

As a general security principle, servers should treat incoming data as untrusted. If a server parses that data before checking who sent it, anyone who can reach the server may be able to exercise bugs in the parser. Authentication cannot block a request from code that runs before the authentication check. This makes the order of processing an important part of security.

Hex.pm’s parser handled request bodies before routing and authentication. In this incident, an unauthenticated POST request to any site address could reach it. The parser accepted a map with a __struct__ key; the crafted data then triggered an error-reporting path that ultimately ran commands. The attacker did not need a valid account to reach that path.

The flaw was fixed by changing the decoder to reject any term containing a map with that key. The team had all servers on the patched build within about 15 minutes of the first malicious request. More broadly, checking input carefully and limiting what parsers can accept are useful safeguards, but they do not replace careful handling of every path that processes untrusted requests.

07

How do package registries and signing systems help developers trust the software dependencies they install?

A package registry is a service developers use to find and fetch software dependencies. In general, a signing system lets a client check whether signed data matches a trusted signing key; this can help reveal changes to that data. These are general purposes of registries and signing, not details about the exact design of Hex.pm’s planned replacement system.

In the incident, the attacker could have read Hex.pm’s registry signing key, and the team had not yet replaced it. Until the new client shipped, maintainers advised users to fetch packages only from repo.hex.pm and avoid third-party mirrors. They said a client update with a new registry signing system was expected within days.

The advice matters because developers rely on the registry to fetch dependencies for their projects. Users were also told to update the Hex client when that release arrived. The article does not describe how the new signing system will work or claim that it was already in place. It reports that package checks found no changes, while possible access to stored data remained unresolved.

This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.

Read more in the JupiteX app

Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.

Or read more news on the web