Hex urges password and 2FA resets after server intrusion

Hex urges password and 2FA resets after server intrusion

Add CyberWorldOpsto your preferred sources on Google
Hex urges password and 2FA resets after server intrusion
Vulnerabilities

Illustrative image generated with AI

Hex is asking users to change passwords and reset two-factor authentication after an attacker ran commands on six web servers supporting the Elixir and Erlang package manager on November 23, 2026. In its incident report, Hex said it found no unauthorized package modifications, database changes or lasting access, but unlogged database reads leave account data potentially exposed.

The data at risk includes email addresses, password hashes, API key hashes, two-factor authentication secrets, sessions and audit logs. Organizations using private packages or documentation also face uncertainty about possible reads from compromised servers; Hex said it would contact affected organizations directly.

Hex has fixed the server vulnerability and replaced infrastructure credentials and the keys used to sign sessions and access tokens, logging everyone out of hex.pm and Hex clients. A replacement registry signing system that supports key rotation remains under development. Until the associated client releases arrive, Hex tells users to fetch packages only from repo.hex.pm and avoid third-party mirrors.

A request could trigger commands before login

Hex’s security advisory, published November 24, identifies the actively exploited flaw as CVE-2026-129514, with a CVSS severity score of 10.0 out of 10. It affects hex.pm code from February 23, 2016, before November 23, 2026: commits beginning with ab1bbcef7cc8395d1056d3b1aa6a174353492d59 and before the fix, 379b0a29bcc95164249f38ad7d772a37a8ff9533.

The weakness involved deserialization—turning incoming encoded data into application values. Hex’s parser processed unauthenticated POST requests with the content type application/vnd.hex+erlang before routing or authentication, making the vulnerable path reachable through any route.

The decoder, Plug.Crypto.non_executable_binary_to_term/2 with [:safe], rejected functions and new atoms, Erlang’s named constants, but accepted maps containing a __struct__ key. In Elixir, that key identifies a structured value’s module. An attacker could therefore supply a fake structure that selected which implementations the application invoked.

The exploit turned error handling into a command-execution chain. Plug.MethodOverride tried to read _method from the fake structure, triggering an UndefinedFunctionError. Sentry, Bandit’s error logging and the JSON log formatter then inspected request data or stack-frame arguments. That inspection invoked Ecto.Query.DynamicExpr, whose handling of its binding field passed execution to an attacker-controlled DBConnection.Stream.

Query encoding failed before a database connection was checked out, but the error path still invoked the stream’s :log callback. Its {module, function, args} values came from the request, allowing operating-system commands to run as the BEAM process user—the account running the Erlang virtual machine. That account could read application environment values holding the database URL, storage credentials and registry signing key. The malicious request still ended with an ordinary HTTP 500 error response.

The fix rejects any decoded term containing a map with a __struct__ key and returns HTTP 400. Hex said this shared decoder check covers every route accepting the format, and its local reproduction confirmed that the old build executed the command while the patched build rejected it.

What Hex observed and checked

Hex traced activity from two attacker addresses back to November 19. Repeated downloads of hex.pm’s dependencies suggested that the attacker built a local copy for testing. The first request on November 23 arrived at 18:14:21 UTC; 69 exploit requests reached servers between 18:16:00 and 18:29:33. A restart at 18:28 introduced three new servers still running vulnerable code, bringing the affected total to six.

Sentry recorded an error for every exploit request. Hex’s first server response followed at 18:23:55, and it added a firewall rule at 18:27. All web, worker and job servers were replaced with patched builds between 18:30 and 18:31; the firewall took full effect between 18:30 and 18:33. No exploit request from either address succeeded after 18:29:33.

Hex deactivated the affected AWS access key at 18:49 and received a report describing the same vulnerability at 19:07. Most infrastructure credentials had been replaced by 20:21. By 10:42 on November 24, it had rotated every credential the attacker could have read except the registry signing key and a few low-impact secrets, including completing the database password replacement.

The investigation compared a database copy from before the attack with the live database. Hex attributed every observed row change to legitimate activity and found no unexpected changes to tables, functions, roles or permissions, while acknowledging that reverted or subsequently overwritten changes could escape that comparison. Process checks found no shells, and cloud audit logs showed no new keys, accounts or API calls from the attacker addresses, or writes by hex.pm’s Kubernetes service accounts.

Package checks covered all 23 releases published during the incident, 62 package files and 186 registry files written since 18:00. They matched audit records or database contents, and no older release changed. Documentation archives lacked stored checksums for comparison.

Storage access logs showed requests from Hex’s own nodes and no external credential use. Private-package reads coincided with releases by the same organizations, although reads from a compromised server would look internal. CDN logs showed no requests from the attacker addresses to private documentation over the preceding 30 days, but direct storage reads were unlogged.

Database reads, environment-variable reads and shell commands were also unlogged. Network traffic stayed within normal levels except on one worker server, which peaked at 0.47 MB/s against its usual maximum of 0.29 MB/s.

Hex reported a personal data breach to Sweden’s IMY at 22:58 on November 23, notified CISA at 23:05 and submitted an early warning to ENISA at 23:26. It published the CVE on November 24 at 13:48.

Related fixes and user action

The investigation uncovered the same vulnerability class in Ash’s keyset pagination, which uses client-supplied cursors to move through results. Crafted structures could lead to command execution or SQL injection. Hex said Ash fixed CVE-2026-124283 in ash 3.38.0 on November 24.

Hex also described further hardening work for plug_crypto, plug, ecto and db_connection, including rejecting structures earlier and preventing stream-supplied logging callbacks. The latter is tracked as CVE-2026-133555. SecurityWeek reported patches for associated defects in db_connection and flop, the latter tracked as CVE-2026-130411.

Hex users should follow the service’s instructions:

  • Change the password at hex.pm. Hex uses bcrypt to slow password guessing, but weak passwords remain vulnerable.
  • Reset two-factor authentication at hex.pm/dashboard/security: under Authenticator App, select Setup New App, verify a code from the new entry and store the new recovery codes. This also works where an organization requires two-factor authentication and prevents disabling it.
  • Check links in emails claiming to come from Hex and ensure they lead to hex.pm. Forward suspicious messages to [email protected].

Hex says API-key rotation is unnecessary solely because hashes may have been exposed: its keys are 128-bit random values stored using HMAC-SHA256, which it considers beyond practical brute-force recovery.

When the client release supporting the new registry signing system becomes available, Hex instructs users to update with mix local.hex --force and update rebar3 or Gleam if used. Until then, fetch packages only from repo.hex.pm.

Read next

Sources

CVEs covered in this article

Back to home

Latest Cybersecurity News

All cybersecurity news →