Blog / news

Hex.pm security incident: fix deployed in 20 minutes

, 5 min read

The hex.pm security incident began when an unauthorized third party exploited a vulnerability in the package registry and ran commands on its web servers. Hex blocked the traffic and deployed a fix within 20 minutes on November 23, 2026. The team says it found no evidence that packages or database contents were modified, but it cannot rule out that the attacker read data stored in the database.

What happened

Hex's error tracker Sentry recorded its first error at 18:16:00 UTC, and logged an error for every malicious request that followed. Between 18:16 and 18:29 the attacker sent 69 requests, and six of Hex's web servers were affected.

The response, in UTC:

  • 18:27: a firewall rule was added to block the attacker's traffic, taking full effect between 18:30 and 18:33.
  • 18:30 to 18:31: every hex.pm server was replaced with a patched build that rejects the payloads.
  • 18:33 to 18:38: further requests from the attacking address were denied.
  • 18:35: the team started going through production logs and the database.
  • 18:47 to 18:49: a replacement AWS access key was created, then the key used by the affected servers was deactivated.
  • 19:07: an email arrived with a security report describing the same vulnerability.
  • 20:21: most infrastructure credentials had been rotated. The database password followed on November 24.
  • 22:58: a personal data breach was reported to IMY, the Swedish data protection authority.
  • 23:05: the incident was reported to CISA, the US Cybersecurity and Infrastructure Security Agency, which confirmed receipt at 23:43.
  • 23:26: an early warning went to ENISA, the EU Agency for Cybersecurity.

By 10:42 on November 24, Hex had rotated every credential the attacker could have read, except the registry signing key and a few low-impact secrets. The write-up, by Peter Ullrich, Jonatan Männchen and Eric Meadows-Jönsson, was published at 13:48.

The open part is the database. Reads are not logged, so Hex cannot rule out that the attacker accessed email addresses, password hashes, API key hashes, 2FA secrets, sessions and audit logs. The storage side looks cleaner: Hex checked every file written during the incident against its database and found nothing unexpected. Reads of private packages in that window came from Hex's own servers and lined up with releases the same organizations published at the time. A read made from a compromised server would look identical, so one cannot be fully excluded, and reads of private documentation are not logged at all.

Background

Hex is the registry that Elixir, Erlang and Gleam projects pull dependencies from. The instructions in the post mention mix, rebar3 and Gleam tooling, which are the clients that talk to it.

Two things make an incident here different from a random server breach. First, packages: if someone could rewrite a published package, every project depending on it would get the changed code on its next install. Hex found no evidence of that. Second, trust: the post mentions the registry signing key and a planned signing system that supports key rotation, without explaining how signing works. What we do know is that the signing key was one of the few secrets not rotated, and that Hex is now rebuilding the system around it.

Why the hex.pm security incident matters

Everyone was logged out. Replacing the keys that sign sessions and access tokens invalidated existing logins on hex.pm and in Hex clients, so you will need to sign in again.

Three things Hex asks users to do:

  1. Change your password at hex.pm.
  2. Reset 2FA at hex.pm/dashboard/security: under "Authenticator App" pick "Setup New App" and verify a code from the new entry. You get a new secret and new recovery codes, so store the new codes. Hex says this works even when an organization requires 2FA and refuses to let you disable it.
  3. Update your Hex client when the release with the new signing system ships in the coming days. Until then, use only repo.hex.pm and not third-party mirrors. To update, run mix local.hex --force, and update rebar3 or Gleam if you use them.

Because email addresses may have been exposed, treat messages claiming to come from Hex with suspicion. Check that links lead to hex.pm, and forward suspicious emails to security@hex.pm. That warning is worth passing on to anyone on your team with a Hex account, since the safest move is to reach the dashboard by typing the address yourself rather than clicking through from an email.

What comes next

  • New Hex client releases with the new registry signing system are due "in the coming days", per the post. No exact date is given.
  • Fixes for the vulnerability are already deployed, with further hardening fixes in progress.
  • Hex will contact organizations affected by private package or documentation exposure directly. It has not named any.
  • The database password was the last major credential, rotated on November 24.
  • What is not known: whether the attacker actually read anything from the database. Hex says reads are not logged, so it may never be able to answer that.

Sources