hexpmに認証不要のRCE脆弱性、悪用を確認し修正版あり
Summary
Elixir製のパッケージレジストリhexpmに、認証なしでサーバー上のOSコマンドを実行される脆弱性があり、hex.pmへの悪用が確認されました。自前でhexpmを動かす組織は修正コミットへ更新し、侵害の跡も調べてください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Elixir製のパッケージレジストリhexpmに、認証なしでサーバー上のOSコマンドを実行される脆弱性があり、hex.pmへの悪用が確認されました。自前でhexpmを動かす組織は修正コミットへ更新し、侵害の跡も調べてください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| hexpmhexpm |
≥ ab1bbcef7cc8395d1056d3b1aa6a174353492d59, < 379b0a29bcc95164249f38ad7d772a37a8ff9533→ 379b0a29bcc95164249f38ad7d772a37a8ff9533 |
379b0a29bcc95164249f38ad7d772a37a8ff9533 |
Original description The description as published by the source.
Summary
Deserialization of Untrusted Data vulnerability in the application/vnd.hex+erlang request body parser in hexpm hexpm allows an unauthenticated remote attacker to execute operating system commands via a crafted Erlang external term format request body. This vulnerability was actively exploited against the hex.pm service on 2026-11-23.
HexpmWeb.ErlangFormat.decode/1 in lib/hexpm_web/erlang_format.ex decodes the body with Plug.Crypto.non_executable_binary_to_term/2, which accepts maps that have a __struct__ key. HexpmWeb.PlugParser.parse/5 returns the decoded term as the request params. The parser runs in the endpoint before routing and authentication, so a POST to any route reaches it. Elixir dispatches protocols on the __struct__ key, so the client selects which Inspect and Enumerable implementations run when error reporting inspects the params. A chain through Ecto.Query.DynamicExpr and DBConnection.Stream reaches an apply/3 call on a {module, function, args} tuple taken from the request body.
This issue affects hex.pm: from 2016-02-23 before 2026-11-23; hexpm/hexpm: from ab1bbcef7cc8395d1056d3b1aa6a174353492d59 before 379b0a29bcc95164249f38ad7d772a37a8ff9533.
Details
1. Decoding. HexpmWeb.Endpoint runs Plug.Parsers with HexpmWeb.PlugParser ahead of the router, so the parser handles every route before any authentication plug. For the content type application/vnd.hex+erlang, HexpmWeb.PlugParser.parse/5 passes the body…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- web github.com
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web hex.pm