# Hex.pm Unauthenticated RCE (CVE-2026-129514, CVSS 10.0) Exploited to Compromise 6 Package Registry Servers

> An unauthenticated remote code execution flaw in hexpm's Erlang-term request body decoder was exploited on 2026-11-23 to run OS commands on six production hex.pm web servers. A map with a __struct__ key chains through Ecto and DBConnection error handling into an attacker-chosen {module, function, args} call. No package modification was found, but database reads cannot be ruled out.

- **Published:** 2026-11-25T09:53:28Z
- **Last reviewed:** 2026-11-25T09:53:28Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6845
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6845.png
- **ID:** TL-2026-6845
- **Severity:** CRITICAL (CVSS 10)
- **Category:** VULNERABILITY
- **Status:** MONITORING
- **Detections:** 9 (1 shown free below) · **IOCs:** 9 (2 shown free below)
- **CVEs:** CVE-2026-129514, CVE-2026-133555, CVE-2026-124283, CVE-2026-130411

## Description

On Monday 2026-11-23 an unauthorized third party exploited a flaw in the hexpm server (the software behind the hex.pm package registry for Elixir/Erlang/Gleam) and executed OS commands on six production web servers. Hex.pm's incident report (2026-11-24) records 69 exploit requests from two source addresses between 18:16 and 18:29 UTC. The first exploit request arrived at 18:16:00 UTC, the first file created by the exploit on a server at 18:16:46, and the last exploit request reached a server at 18:29:33. A firewall block was added at 18:27, and all web, worker and job servers were replaced with the patched build by 18:31 UTC. A restart at 18:28 brought up three new servers still running the vulnerable build, which is why six servers were hit. The same two addresses had been active since about 2026-11-19, repeatedly downloading hex.pm's dependencies, which the Hex team reads as the attacker building a local copy to test against.

Root cause (GHSA-9pmm-hf4r-27pg, CWE-502): a custom parser (HexpmWeb.PlugParser, using HexpmWeb.ErlangFormat.decode/1) handles the application/vnd.hex+erlang content type with Plug.Crypto.non_executable_binary_to_term/2 and the [:safe] option. It runs in the endpoint before routing and authentication, so any unauthenticated POST to any route reaches it. [:safe] rejects functions and new atoms but does not restrict maps, so a map with a __struct__ key is accepted as a struct. The relevant safety check was removed on 2016-02-23, so the flaw existed from then until the fix.

Exploit chain: (1) Plug.MethodOverride reads body_params["_method"]; on a struct this calls fetch/2 on the struct's module. The attacker chose Ecto.Query.DynamicExpr, which has no fetch/2, so an UndefinedFunctionError is raised with the attacker's struct in the stack trace. (2) Error reporting (Sentry, Bandit's error log, the JSON log formatter) calls inspect on that data. The Inspect implementation for DynamicExpr calls Enum.map/2 on the binding field without checking that it is a list. (3) The binding field holds a DBConnection.Stream struct, whose Enumerable implementation calls DBConnection.reduce/3 and then declare/4. (4) On the error path the stream's :log option is still applied; a {module, function, args} tuple from the request is run as apply(mod, fun, [entry | args]). The attacker therefore controls module, function and arguments, and can call an OTP standard-library function that applies a trailing module/function/args list, running an OS command as the BEAM process user. The Inspect call runs inside a rescue, so the client just sees a normal 500 response. The commands run and the files created were not disclosed.

Impact: the BEAM user can read the application environment, which per the advisory holds the database URL, storage credentials and the registry signing key. The Hex team found no evidence of package modification, database writes, or persistent access, and found no shells in the process list of affected servers. Because database reads are not logged, they cannot rule out access to email addresses, password hashes (bcrypt), API key hashes (HMAC-SHA256 of random 128-bit values), 2FA secrets, sessions and audit logs. Verification: 23 releases published during the incident match the audit log, 62 package files and 186 registry files written since 18:00 match database contents, and a database copy taken at 18:13:59 UTC was compared row by row to the live database. Remediation by Hex included rotating storage, CDN, email and database credentials and session/token signing keys (logging out all users and clients), deactivating the AWS key used by the affected servers, and a hardening pass in plug_crypto, plug, ecto and db_connection. The registry signing key and a few low-impact secrets had not been rotated at the time of the report; a new registry signing system with key rotation is being built. Users were asked to change passwords and reset 2FA.

Related library CVEs named in the coverage: CVE-2026-133555 (db_connection, the :log callback on stream structs; not exploitable in db_connection alone), CVE-2026-124283 (ash 3.31.3 up to 3.38.0, requires keyset pagination with a client-supplied cursor, certain sort field types and an unset default signing secret) and CVE-2026-130411 (flop, similar conditions around pagination cursors). Attribution is unknown; no attacker IP addresses, user agents, hashes or malware names were published. Self-hosted hexpm registry copies are affected until they deploy the fix.

## MITRE ATT&CK

- T1595 Active Scanning
- T1190 Exploit Public-Facing Application
- T1059 Command and Scripting Interpreter
- T1552 Unsecured Credentials
- T1005 Data from Local System

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**hexpm Erlang-Term POST Error Burst — Probing and Exploitation (CVE-2026-129514)** (`TL-2026-6845-SPL-002`)

Counts 400/500 responses to application/vnd.hex+erlang POSTs per source IP in 5 minute windows. Exploit requests on vulnerable builds surface as a normal 500 (the error is rescued), and as 400 after fix commit 379b0a29 rejects __struct__ maps; the same two attacker addresses had probed hex.pm since about 2026-11-19 before 69 exploit requests on 2026-11-23.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1595, T1595.002
- **Data sources:** nginx:access (index=web), reverse_proxy_logs
- **Severity:** high
- **Confidence:** medium

### Splunk SPL

```spl
index=web sourcetype="nginx:access" http_method=POST content_type="application/vnd.hex+erlang*" status IN (400,500) earliest=-24h
| bin _time span=5m
| stats count as err_requests dc(uri_path) as distinct_routes values(status) as statuses by src_ip, host, _time
| where err_requests>=5
| eval note="CVE-2026-129514 hexpm exploit/probe burst: 400 = patched build rejecting __struct__, 500 = vulnerable build rescued error"
| sort - err_requests
```

### Microsoft KQL

```kql
// CVE-2026-129514 burst of 400/500 responses to vnd.hex+erlang POSTs (probe/exploit attempts; incident saw 69 requests in 13 minutes)
NginxAccess_CL
| where TimeGenerated > ago(24h)
| where HttpMethod_s =~ "POST" and ContentType_s startswith "application/vnd.hex+erlang" and Status_d in (400, 500)
| summarize ErrRequests=count(), Routes=dcount(UriPath_s), Statuses=make_set(Status_d) by ClientIP_s, Computer, bin(TimeGenerated, 5m)
| where ErrRequests >= 5
| order by ErrRequests desc
```

### Sigma

```yaml
title: hexpm Burst of Erlang-Term POST Errors (CVE-2026-129514)
id: 7c1e5a52-3f0b-4d6e-9a41-6845a0000002
status: experimental
description: Detects POST requests with Content-Type application/vnd.hex+erlang answered with 400 or 500, indicating exploit or probe attempts against HexpmWeb.PlugParser. Aggregate by source IP (>=5 in 5 minutes) in the SIEM.
references:
    - https://hex.pm/blog/security-incident-on-hexpm
    - https://github.com/hexpm/hexpm/security/advisories/GHSA-9pmm-hf4r-27pg
    - https://github.com/hexpm/hexpm/commit/379b0a29bcc95164249f38ad7d772a37a8ff9533
author: Threadlinqs Team
date: 2026/11/25
tags:
    - attack.reconnaissance
    - attack.t1595
    - attack.t1595.002
    - attack.initial-access
    - attack.t1190
    - cve.2026.129514
logsource:
    category: webserver
detection:
    selection:
        cs-method: 'POST'
        c-content-type|startswith: 'application/vnd.hex+erlang'
        sc-status:
            - 400
            - 500
    condition: selection
falsepositives:
    - Buggy or misconfigured Hex client/mirror repeatedly posting malformed bodies
    - Load or fuzz testing in staging
level: medium

```

**Known false positives:**

- Misbehaving Hex client or mirror retrying malformed requests
- Staging load tests

**Tuning notes:** Tune the threshold (>=5 per 5 minutes) to your baseline. On patched servers any 400 to this content type is suspicious; on unpatched servers a 500 is the exploit signature because the error path is rescued. Allow-list known CI egress IPs. Pivot source IPs against activity from 2026-11-19 onward (repeated dependency downloads suggest attacker staging).

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- hexpm UndefinedFunctionError fetch/2 Struct Gadget in App Logs — Exploitation (CVE-2026-129514) (locked: unlock with TL Creds)
- BEAM VM Child Fetch/Reverse-Shell Command — Post-Exploitation (CVE-2026-129514) (locked: unlock with TL Creds)
- BEAM VM Child Harvesting Environment Secrets — Credential Access (CVE-2026-129514) (locked: unlock with TL Creds)
- hexpm DynamicExpr/DBConnection.Stream Gadget Terms in Logs — Exploitation (CVE-2026-129514) (locked: unlock with TL Creds)
- Unexpected BEAM VM Child Process — Post-Exploitation (CVE-2026-129514) (locked: unlock with TL Creds)
- BEAM VM Child External Connection — Exfiltration/Staging (CVE-2026-129514) (locked: unlock with TL Creds)
- hexpm Unauthenticated application/vnd.hex+erlang POST — Exploitation (CVE-2026-129514) (locked: unlock with TL Creds)
- BEAM VM Child Shell or Downloader — Post-Exploitation Execution (CVE-2026-129514) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (2 of 9)

Defanged, TLP:CLEAR.

- File hash: `379b0a29bcc95164249f38ad7d772a37a8ff9533`
- File hash: `ab1bbcef7cc8395d1056d3b1aa6a174353492d59`

Full set of 9 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [Hex.pm incident report: Security incident on hex.pm](https://hex.pm/blog/security-incident-on-hexpm)
- [hexpm GitHub security advisory GHSA-9pmm-hf4r-27pg](https://github.com/hexpm/hexpm/security/advisories/GHSA-9pmm-hf4r-27pg)
- [hexpm fix commit 379b0a29 - Refuse structs in Erlang term request bodies](https://github.com/hexpm/hexpm/commit/379b0a29bcc95164249f38ad7d772a37a8ff9533)
- [The Hacker News: Hackers Exploited CVSS 10.0 Hex.pm RCE](https://thehackernews.com/2026/11/hackers-exploited-cvss-100-hexpm-rce.html)
- [NVD: CVE-2026-129514](https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-129514)
- [EEF CNA record: CVE-2026-129514](https://cna.erlef.org/cves/CVE-2026-129514.html)
- [OSV: EEF-CVE-2026-129514](https://osv.dev/vulnerability/EEF-CVE-2026-129514)
- [EEF CNA record: CVE-2026-133555 (db_connection)](https://cna.erlef.org/cves/CVE-2026-133555.html)
- [db_connection advisory GHSA-gmmq-fw75-wq46](https://github.com/elixir-ecto/db_connection/security/advisories/GHSA-gmmq-fw75-wq46)
- [EEF CNA record: CVE-2026-124283 (ash)](https://cna.erlef.org/cves/CVE-2026-124283.html)
- [EEF CNA record: CVE-2026-130411 (flop)](https://cna.erlef.org/cves/CVE-2026-130411.html)
- [Elixir Forum: Hex.pm security incident (maintainer clarifications)](https://forum.elixirforum.com/t/hex-pm-security-incident/77503)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6845
