Hex.pm CVE-2026-129514: Erlang-term deserialization RCE exploited on six registry servers; users logged out, change passwords and reset 2FA
SockAnalyst · Security+ certified analyst.
What happened
On November 23, 2026 an unauthorized party exploited CVE-2026-129514 (CVSS 4.0 10.0, CWE-502) to run operating system commands on six hex.pm web servers, the package registry Elixir and Erlang developers pull dependencies from. hex.pm decoded unauthenticated request bodies of content type application/vnd.hex+erlang with Plug.Crypto.non_executable_binary_to_term/2, which blocks functions and new atoms but let maps with a __struct__ key through, before routing and authentication. A crafted fake struct raised an error; error reporting (Sentry, Bandit logging, the JSON log formatter) then ran inspect on it, and a chain through Ecto.Query.DynamicExpr and DBConnection.Stream reached an apply/3 on an attacker-supplied {module, function, args} tuple, running commands as the BEAM user. The safety check had been removed on February 23, 2016. Load balancer logs show 69 exploit requests from two addresses between 18:16 and 18:29 UTC; a firewall block and a patched build (commit 379b0a2, rejects structs with a 400) were in place by 18:31 to 18:33 UTC. The team found no modified packages (all 23 releases published during the attack match the audit log), no database writes, no lasting access and no new cloud keys. Because database reads, environment reads and shell commands are not logged, it cannot rule out that the attacker read email addresses, password hashes, API key hashes, 2FA secrets, sessions, audit logs, or the server credentials, including the registry signing key. Hex rotated storage, CDN, email and database credentials and the session/token signing keys (logging everyone out) and reported the breach to Sweden's IMY, CISA and ENISA. While investigating, the team found the same struct class of bug in Ash (CVE-2026-124283, fixed in 3.38.0); db_connection (CVE-2026-133555, fixed 2.10.3) and Flop (CVE-2026-130411) also shipped fixes on November 24. CVE-2026-129514 is not in CISA KEV as of November 25, 2026.
Who's affected
Everyone with a hex.pm account (passwords, 2FA and sessions may have been read); developers and CI pipelines that fetch Hex packages, until the new Hex client with a rotatable registry signing key ships, because the old signing key was readable by the attacker and has not been replaced yet; organizations that run their own copy of the hexpm server code. Developers who only fetch public packages and never created an account have nothing to reset. Separately, Elixir apps using ash 3.31.3 to before 3.38.0, db_connection 1.1.0 to before 2.10.3, or affected Flop versions with client-supplied cursors.
✅ Fix / patch
- Hex account holders: change your hex.pm password; reset 2FA at hex.pm/dashboard/security (Authenticator App > Setup New App) and store the new recovery codes; log the client back in with mix hex.user auth (or rebar3 hex user auth). API keys do not need rotating per Hex (128-bit random, stored as HMAC-SHA256).
- Until the Hex client release with the new registry signing system ships (expected within days), fetch packages only from repo.hex.pm and do not trust third-party mirrors; then update with mix local.hex --force and update rebar3/Gleam.
- Treat emails claiming to be from Hex with suspicion: check links go to hex.pm; forward suspicious mail to [email protected].
- If you self-host hexpm: deploy commit 379b0a2 or later (decoder rejects any map with a __struct__ key) and rotate every secret in the app environment (database URL, storage credentials, signing keys).
- In your own Elixir apps: upgrade ash to 3.38.0, db_connection to 2.10.3, and Flop to 0.26.7 / 0.27.3 / 0.28.1 / 0.29.2; never decode untrusted Erlang terms (binary_to_term, even with :safe) on unauthenticated input.
🔎 Quick hunt check
No attacker IPs, hashes or file names have been published (Hex says the activity came from two addresses). For self-hosted hexpm or any Elixir/Phoenix service: look for unauthenticated POSTs with Content-Type application/vnd.hex+erlang that got HTTP 500, and for the BEAM VM (beam.smp / erl) spawning shells or download tools. For developer and CI fleets: Hex package fetches going to hosts other than repo.hex.pm / hex.pm (mirrors) while the signing key is still being replaced.
MITRE ATT&CK: T1190, T1059.004, T1552.001, T1078
IOCs
No IOCs (IPs, domains or hashes) published by the sources yet.
Hunt queries
Starting points built only from published indicators. Field names vary; tune before use.
```Hex.pm CVE-2026-129514: Erlang-term POSTs answered 500 (self-hosted hexpm / Phoenix) + BEAM VM spawning shells + Hex fetches to non-official mirrors, since Nov 19, 2026```
index=* earliest=11/19/2026:00:00:00 ((tag=web OR sourcetype=access_combined OR sourcetype=nginx:plus:access OR sourcetype=aws:elb:accesslogs) http_method=POST (http_content_type="application/vnd.hex+erlang*" OR cs_content_type="application/vnd.hex+erlang*")) OR (tag=process (parent_process_name IN ("beam.smp","beam","erl","erlexec") OR parent_process="*beam.smp*")) OR (tag=network (process_name IN ("beam.smp","mix","rebar3") OR app="hex") dest_host=* NOT dest_host IN ("repo.hex.pm","hex.pm","builds.hex.pm","hexdocs.pm"))
| eval child=lower(coalesce(process_name, "")), code=coalesce(status, "-")
| eval signal=case(isnotnull(http_method), if(code="500" OR code=500, "erlang_term_POST_500", "erlang_term_POST"), match(child, "^(sh|bash|dash|curl|wget|nc|ncat|python3?|perl|base64)$"), "beam_spawned_shell_or_downloader", isnotnull(dest_host), "hex_fetch_non_official_host")
| where isnotnull(signal)
| stats count min(_time) as first_seen max(_time) as last_seen values(uri_path) as paths values(src_ip) as src_ips values(process) as cmdlines values(dest_host) as dest_hosts by signal, host
| convert ctime(first_seen) ctime(last_seen)
| sort signal - count
``` beam_spawned_shell is noisy if your release scripts shell out: baseline first. ```// Hex.pm CVE-2026-129514: BEAM VM child shells/downloaders + Hex/mix/rebar3 traffic to hosts other than repo.hex.pm/hex.pm + web/WAF logs of Erlang-term POSTs, since Nov 19, 2026
let Since = datetime(2026-11-19);
let Official = dynamic(["repo.hex.pm","hex.pm","builds.hex.pm","hexdocs.pm"]);
union isfuzzy=true
(DeviceProcessEvents | where TimeGenerated >= Since and InitiatingProcessFileName in~ ("beam.smp","beam","erl","erlexec")
| where FileName in~ ("sh","bash","dash","curl","wget","nc","ncat","python","python3","perl","base64")
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Detail = make_set(ProcessCommandLine, 20) by Host = DeviceName
| extend Check = "BEAM VM spawned shell/downloader"),
(DeviceNetworkEvents | where TimeGenerated >= Since and InitiatingProcessFileName in~ ("beam.smp","mix","rebar3") and InitiatingProcessCommandLine has_any ("hex","deps.get","rebar3")
| where isnotempty(RemoteUrl) and not(RemoteUrl has_any (Official)) and RemoteUrl !has "github.com"
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Detail = make_set(RemoteUrl, 20) by Host = DeviceName
| extend Check = "Hex fetch to non-official host (mirror?)"),
(CommonSecurityLog | where TimeGenerated >= Since and RequestMethod == "POST" and AdditionalExtensions has "application/vnd.hex+erlang"
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Detail = make_set(RequestURL, 20) by Host = DestinationHostName
| extend Check = "Erlang-term POST (WAF/proxy)")
| order by Check asc, Count desc⏱ CISA deadline
Not in CISA KEV as of Nov 27, 2026.
Sources
- Hex: Security incident on hex.pm (Nov 24, 2026)
- hexpm/hexpm GitHub advisory GHSA-9pmm-hf4r-27pg: Unauthenticated RCE through struct values in Erlang term request bodies, CVE-2026-129514 (Nov 24, 2026)
- The Hacker News: Hackers Exploited CVSS 10.0 Hex.pm RCE Flaw to Compromise 6 Package Registry Servers (Nov 25, 2026)
Related playbooks
- RIKEN Fugaku supercomputer breach: intruder entered through the public status dashboard and took users' SSH keys and stored credentials · Breach · 2026-11-17
- N-able Mail Assure and SpamExperts CVE-2026-134624: SSRF found in hosted-cloud breach probe now exploited per CISA KEV, fixed in build 20261121.1943, portals restored · Breach · 2026-11-20
- DreamHost File Manager breach: FTP/SFTP passwords and some webmail sessions stolen · Breach · 2026-11-06
Get the SockAnalyst Weekly Brief free, every Thursday.
One email a week with the KEV deadlines, patches and hunt queries that matter. New playbooks still post here on the site every morning.
Subscribe free
SockAnalyst