Security —

Hex.pm security incident allows RCE, prompts password and 2FA resets

The vulnerability in Hex.pm, cataloged as CVE-2026-129514, allowed an unauthorized third party to execute commands on the company's web servers on November 23, 2026.

Hex.pm security incident allows RCE, prompts password and 2FA resets

The security team successfully contained the intrusion by blocking the malicious traffic and implementing a remedy within twenty minutes. Subsequently, a notification regarding this precise flaw was received.

Although no evidence surfaced indicating that the attacker altered packages, modified the database, or maintained persistent access to the infrastructure, the inability to log database reads prevents absolute certainty regarding whether the attacker accessed sensitive data. This potentially exposed information includes email addresses, password hashes, API key hashes, secrets for two-factor authentication, session data, and audit logs. Due to the possible exposure of email addresses, users are advised to exercise caution with any correspondence purportedly originating from Hex, ensuring that embedded links direct to hex.pm and forwarding suspicious messages to security@hex.pm.

The investigation confirmed that all files written to package storage during the incident period matched the database records, showing no unexpected entries. Furthermore, all retrievals of private packages during that timeframe originated from the company's own servers and corresponded with releases published by those organizations at the same time. While a read originating from a compromised server would mimic legitimate activity, making full exclusion impossible, documentation reads of private packages are not logged. The organization intends to communicate directly with any affected entities.

Because the attacker's commands could potentially access the credentials utilized by the servers, those credentials were subsequently changed across the storage, CDN, email, and database services, alongside the keys responsible for signing sessions and access tokens. This action resulted in the forced log-out of all users from hex.pm and associated Hex clients. The development team is currently engineering a novel registry signing mechanism that incorporates support for key rotation, with updated Hex client releases anticipated in the near future. Until this new system is deployed, users must refrain from trusting third-party mirrors and exclusively retrieve packages from repo.hex.pm.

The vulnerability itself stemmed from hex.pm decoding unauthenticated request bodies formatted in Erlang term format using Plug.Crypto.non_executable_binary_to_term/2. While this function typically prevents most dangerous terms, it permitted the passage of struct values. When these decoded struct values were correctly sequenced, they facilitated a remote command execution (RCE).

In parallel investigation, a similar vulnerability was discovered within Ash, where its keyset pagination accepted specially crafted structs within client-supplied cursors, which could lead to SQL injection or command execution. This issue was reported, and the Ash team released a patch in ash 3.38.0 on November 24, tracking this as CVE-2026-124283. The fix implemented in the hexpm commit 379b0a2 mandates that the decoder rejects any term containing a map with a "__struct__" key, returning a 400 error. Since this validation resides within the single decoder used for this format, it comprehensively covers every route that accepts this input, thereby closing the initial attack vector against injecting a fraudulent struct into request parameters. Every hex.pm server was running the patched build by 18:31 UTC.

The platform is also developing further hardening measures for these libraries to prevent similar attacks across multiple layers, rather than relying solely on a single decoder check within the request pipeline.

Market participants and institutions should note that this incident highlights systemic risks associated with deserialization vulnerabilities in ecosystem tooling, impacting critical infrastructure components.

For operational mitigation, users must perform several actions: first, change their password on hex.pm. Second, reset two-factor authentication at hex.pm/dashboard/security; under "Authenticator App," select "Setup New App" and confirm a code from the newly generated entry, as this provides a new secret and recovery codes that must be saved, which is necessary when an organization mandates 2FA and resists disabling it. Third, update the Hex client as soon as the release containing the new signing system becomes available, while continuing to use only repo.hex.pm instead of mirrors until then. To perform the update, execute the command mix local.hex --force, and similarly update rebar3 or Gleam if those tools are in use.

The investigation findings detailed in this communication are based on the checks conducted, with transparency maintained regarding areas where checks are ongoing or verification is limited by log availability. For any concerns or unusual activity observed in an account, contact support@hex.pm, and security reports should be directed to security@hex.pm; the organization commits to updating this post as the investigation progresses.

Why it matters

As a platform critical to the Erlang ecosystem, this RCE vulnerability poses a significant risk to dependent projects and infrastructure. Operators must immediately follow the security directives to mitigate potential exposure of credentials and sensitive data.

Earlier coverage

Reported by Lobste.

security

Related coverage

Elsewhere in this edition