world

Hex.pm Discloses RCE Exploit via 10-Year-Old Erlang Struct Flaw

Attackers exploited CVE-2026-129514 on Hex.pm web servers via crafted Erlang terms. Packages stayed clean, but users must reset passwords and 2FA.

Hex.pm Discloses RCE Exploit via 10-Year-Old Erlang Struct Flaw

On November 23, 2026, an attacker exploited a critical remote code execution vulnerability (CVE-2026-129514) on hex.pm, the primary package registry for Elixir, Erlang, and Gleam, executing commands on six web servers within a 13-minute window before maintainers blocked traffic and shipped a fix, according to Hex. While full checksum and database audits confirmed zero unauthorized package modifications, maintainers cannot rule out database reads—prompting global session logouts, infrastructure credential rotation, and a warning to reset passwords and 2FA secrets.

Anatomy of a Four-Hop Erlang Gadget Chain

The technical root cause—absent from hex.pm's request decoder since February 23, 2016—centered on Plug.Crypto.non_executable_binary_to_term/2 called with [:safe] on unauthenticated application/vnd.hex+erlang POST bodies. Although the decoder blocked functions and new atoms, it permitted maps carrying a __struct__ key.

From there, the attacker triggered a four-hop gadget chain: Plug.MethodOverride raised UndefinedFunctionError on the forged struct, error reporting (Sentry/Bandit) invoked the Inspect protocol on Ecto.Query.DynamicExpr, Inspect enumerated a DBConnection.Stream placed in binding, and the error path executed an attacker-supplied {module, function, args} :log tuple as the BEAM OS user. The investigation also uncovered sibling flaws in Ash (CVE-2026-124283, fixed in 3.38.0) and db_connection (CVE-2026-133555), as noted by SOCRadar.

Why Package Registries Face Asymmetric Exposure

Between 18:16 and 18:29 UTC, 69 exploit requests hit six servers—three of which had just spun up on the old build during an 18:28 restart—yet maintainers neutralized the intrusion by 18:31 UTC and rotated AWS, CDN, storage, email, and database credentials. Because database reads, shell commands, and private docs views are unlogged, transparency forced a full precautionary reset even though all 23 releases, 62 package files, and 186 registry files matched checksums.

For the broader ecosystem, the incident proves that even memory-safe BEAM runtimes remain vulnerable when binary serialization formats cross unauthenticated HTTP boundaries.

Second-Order Effects for Elixir, Erlang, and Gleam Teams

Developers using mix, rebar3, or Gleam should avoid third-party mirrors, fetch exclusively from repo.hex.pm, change hex.pm passwords (stored with bcrypt), reset TOTP 2FA secrets, and prepare to update Hex clients once the new key-rotatable registry signing system ships. Maintainers of Elixir/Phoenix apps should immediately audit any endpoint parsing binary_to_term or using Ash keyset pagination below 3.38.0.

What to Watch Next

Watch for Hex's upcoming client releases introducing rotatable registry signing keys alongside multi-layer hardening patches in plug_crypto, plug, ecto, and db_connection.

// sources

// WebZona Studio products

Need a product or service that does not exist yet?

Pitch your idea in our "50 Hours" program — every month we build one community idea free for everyone. Or explore our released products.

// comments (0)

// no comments yet.