{"containers":{"cna":{"affected":[{"collectionURL":"https://hex.pm","cpes":["cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.HexpmWeb.ErlangFormat'","'Elixir.HexpmWeb.PlugParser'"],"packageName":"hex.pm","product":"hexpm","programFiles":["lib/hexpm_web/erlang_format.ex","lib/hexpm_web/plug_parser.ex"],"programRoutines":[{"name":"'Elixir.HexpmWeb.ErlangFormat':decode/1"},{"name":"'Elixir.HexpmWeb.PlugParser':parse/5"}],"vendor":"hexpm","versions":[{"lessThan":"2026-11-23","status":"affected","version":"2016-02-23","versionType":"date"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.HexpmWeb.ErlangFormat'","'Elixir.HexpmWeb.PlugParser'"],"packageName":"hexpm/hexpm","packageURL":"pkg:github/hexpm/hexpm","product":"hexpm","programFiles":["lib/hexpm_web/erlang_format.ex","lib/hexpm_web/plug_parser.ex"],"programRoutines":[{"name":"'Elixir.HexpmWeb.ErlangFormat':decode/1"},{"name":"'Elixir.HexpmWeb.PlugParser':parse/5"}],"repo":"https://github.com/hexpm/hexpm","vendor":"hexpm","versions":[{"lessThan":"379b0a29bcc95164249f38ad7d772a37a8ff9533","status":"affected","version":"ab1bbcef7cc8395d1056d3b1aa6a174353492d59","versionType":"git"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*","versionEndExcluding":"379b0a29bcc95164249f38ad7d772a37a8ff9533","versionStartIncluding":"ab1bbcef7cc8395d1056d3b1aa6a174353492d59","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"analyst","value":"Eric Meadows-Jönsson"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"analyst","value":"Peter Ullrich"},{"lang":"en","type":"analyst","value":"Wojtek Mach"},{"lang":"en","type":"coordinator","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"remediation developer","value":"Eric Meadows-Jönsson"}],"dateAssigned":"2026-11-23T21:43:53.000Z","datePublic":"2026-11-23T18:26:41.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Deserialization of Untrusted Data vulnerability in the <code>application/vnd.hex+erlang</code> 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.</p>\n<p><code>HexpmWeb.ErlangFormat.decode/1</code> in <code>lib/hexpm_web/erlang_format.ex</code> decodes the body with <code>Plug.Crypto.non_executable_binary_to_term/2</code>, which accepts maps that have a <code>__struct__</code> key. <code>HexpmWeb.PlugParser.parse/5</code> 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 <code>__struct__</code> key, so the client selects which <code>Inspect</code> and <code>Enumerable</code> implementations run when error reporting inspects the params. A chain through <code>Ecto.Query.DynamicExpr</code> and <code>DBConnection.Stream</code> reaches an <code>apply/3</code> call on a <code>{module, function, args}</code> tuple taken from the request body.</p>\n<p>This issue affects hex.pm: from 2016-02-23 before 2026-11-23; hexpm/hexpm: from ab1bbcef7cc8395d1056d3b1aa6a174353492d59 before 379b0a29bcc95164249f38ad7d772a37a8ff9533.</p>"},{"base64":false,"type":"text/markdown","value":"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.\n\n`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.\n\nThis issue affects hex.pm: from 2016-02-23 before 2026-11-23; hexpm/hexpm: from ab1bbcef7cc8395d1056d3b1aa6a174353492d59 before 379b0a29bcc95164249f38ad7d772a37a8ff9533."}],"value":"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.\n\nHexpmWeb.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.\n\nThis issue affects hex.pm: from 2016-02-23 before 2026-11-23; hexpm/hexpm: from ab1bbcef7cc8395d1056d3b1aa6a174353492d59 before 379b0a29bcc95164249f38ad7d772a37a8ff9533."}],"impacts":[{"capecId":"CAPEC-586","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An unauthenticated attacker can run operating system commands as the user of the BEAM process. That user can read the environment of the application, which holds the database URL, the storage credentials and the registry signing key.</p>"},{"base64":false,"type":"text/markdown","value":"An unauthenticated attacker can run operating system commands as the user of the BEAM process. That user can read the environment of the application, which holds the database URL, the storage credentials and the registry signing key."}],"value":"An unauthenticated attacker can run operating system commands as the user of the BEAM process. That user can read the environment of the application, which holds the database URL, the storage credentials and the registry signing key."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"NETWORK","baseScore":10,"baseSeverity":"CRITICAL","exploitMaturity":"ATTACKED","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"HIGH","subConfidentialityImpact":"HIGH","subIntegrityImpact":"HIGH","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:A","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"HIGH","vulnIntegrityImpact":"HIGH","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-502","description":"CWE-502 Deserialization of Untrusted Data","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-11-24T13:48:12.692Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"name":"Unauthenticated remote code execution through struct values in Erlang term request bodies","tags":["vendor-advisory","related"],"url":"https://github.com/hexpm/hexpm/security/advisories/GHSA-9pmm-hf4r-27pg"},{"name":"EEF CNA record for CVE-2026-129514","tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-129514.html"},{"name":"OSV record EEF-CVE-2026-129514","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-129514"},{"name":"Introducing commit ab1bbce in hexpm/hexpm","tags":["related"],"url":"https://github.com/hexpm/hexpm/commit/ab1bbcef7cc8395d1056d3b1aa6a174353492d59"},{"name":"Fix commit 379b0a2 in hexpm/hexpm","tags":["patch"],"url":"https://github.com/hexpm/hexpm/commit/379b0a29bcc95164249f38ad7d772a37a8ff9533"}],"source":{"discovery":"EXTERNAL"},"title":"Unauthenticated remote code execution through struct values in Erlang term request bodies","x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Decoding.</strong> <code>HexpmWeb.Endpoint</code> runs <code>Plug.Parsers</code> with <code>HexpmWeb.PlugParser</code> ahead of the router, so the parser handles every route before any authentication plug. For the content type <code>application/vnd.hex+erlang</code>, <code>HexpmWeb.PlugParser.parse/5</code> passes the body to <code>HexpmWeb.ErlangFormat.decode/1</code>, which calls <code>Plug.Crypto.non_executable_binary_to_term/2</code> with <code>[:safe]</code>. That function refuses functions and new atoms. It places no restriction on maps, so a map with a <code>__struct__</code> key passes. In a release every module and function name is an existing atom. When the decoded term is a map, the parser returns it as the body params, and <code>Plug.Parsers</code> merges it into <code>conn.params</code>.</p>\n<p><strong>2. The error.</strong> An Elixir struct is a map whose <code>__struct__</code> key names a module, and protocol dispatch tests only that key. <code>Plug.MethodOverride</code> evaluates <code>body_params[\"_method\"]</code> on every POST. For a struct, <code>Access.get/3</code> calls <code>fetch/2</code> on the named module. <code>Ecto.Query.DynamicExpr</code> does not define <code>fetch/2</code>, so the call raises <code>UndefinedFunctionError</code>, and the top stack frame holds the decoded struct as an argument.</p>\n<p><strong>3. Inspect dispatch.</strong> Error reporting calls <code>inspect/1</code> on the request data and on the stack frame arguments (Sentry, the Bandit error log through <code>Exception.format/3</code>, and the JSON log formatter). <code>inspect/1</code> selects <code>Inspect.Ecto.Query.DynamicExpr</code>, which calls <code>Enum.map/2</code> on the <code>binding</code> field without a check that the field is a list.</p>\n<p><strong>4. Enumerable dispatch.</strong> The <code>binding</code> field holds a <code>DBConnection.Stream</code> struct. Its <code>Enumerable</code> implementation calls <code>DBConnection.reduce/3</code>, which takes <code>conn</code>, <code>query</code>, <code>params</code> and <code>opts</code> from the struct and calls <code>declare/4</code>.</p>\n<p><strong>5. Function call.</strong> <code>declare/4</code> reads the <code>:log</code> option from <code>opts</code>. Query encoding fails before a connection is checked out, and the error path still calls the log hook. For a <code>{module, function, args}</code> tuple the hook is <code>apply(mod, fun, [entry | args])</code>. All three values come from the request body. The log entry takes the first argument position, so the request names an OTP standard library function that applies a trailing module, function and argument list. The inner call runs an operating system command as the user of the BEAM process.</p>\n<p>The <code>Inspect</code> implementation of a struct runs inside a rescue in <code>Inspect.Algebra</code>, so the request ends with the ordinary 500 response for the <code>Plug.MethodOverride</code> error.</p>\n<p>The fix makes <code>HexpmWeb.ErlangFormat.decode/1</code> return an error when any map in the decoded term has a <code>__struct__</code> key. The parser turns that error into a 400 response.</p>"},{"base64":false,"type":"text/markdown","value":"**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 to `HexpmWeb.ErlangFormat.decode/1`, which calls `Plug.Crypto.non_executable_binary_to_term/2` with `[:safe]`. That function refuses functions and new atoms. It places no restriction on maps, so a map with a `__struct__` key passes. In a release every module and function name is an existing atom. When the decoded term is a map, the parser returns it as the body params, and `Plug.Parsers` merges it into `conn.params`.\n\n**2. The error.** An Elixir struct is a map whose `__struct__` key names a module, and protocol dispatch tests only that key. `Plug.MethodOverride` evaluates `body_params[\"_method\"]` on every POST. For a struct, `Access.get/3` calls `fetch/2` on the named module. `Ecto.Query.DynamicExpr` does not define `fetch/2`, so the call raises `UndefinedFunctionError`, and the top stack frame holds the decoded struct as an argument.\n\n**3. Inspect dispatch.** Error reporting calls `inspect/1` on the request data and on the stack frame arguments (Sentry, the Bandit error log through `Exception.format/3`, and the JSON log formatter). `inspect/1` selects `Inspect.Ecto.Query.DynamicExpr`, which calls `Enum.map/2` on the `binding` field without a check that the field is a list.\n\n**4. Enumerable dispatch.** The `binding` field holds a `DBConnection.Stream` struct. Its `Enumerable` implementation calls `DBConnection.reduce/3`, which takes `conn`, `query`, `params` and `opts` from the struct and calls `declare/4`.\n\n**5. Function call.** `declare/4` reads the `:log` option from `opts`. Query encoding fails before a connection is checked out, and the error path still calls the log hook. For a `{module, function, args}` tuple the hook is `apply(mod, fun, [entry | args])`. All three values come from the request body. The log entry takes the first argument position, so the request names an OTP standard library function that applies a trailing module, function and argument list. The inner call runs an operating system command as the user of the BEAM process.\n\nThe `Inspect` implementation of a struct runs inside a rescue in `Inspect.Algebra`, so the request ends with the ordinary 500 response for the `Plug.MethodOverride` error.\n\nThe fix makes `HexpmWeb.ErlangFormat.decode/1` return an error when any map in the decoded term has a `__struct__` key. The parser turns that error into a 400 response."}],"value":"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 to HexpmWeb.ErlangFormat.decode/1, which calls Plug.Crypto.non_executable_binary_to_term/2 with [:safe]. That function refuses functions and new atoms. It places no restriction on maps, so a map with a __struct__ key passes. In a release every module and function name is an existing atom. When the decoded term is a map, the parser returns it as the body params, and Plug.Parsers merges it into conn.params.\n\n2. The error. An Elixir struct is a map whose __struct__ key names a module, and protocol dispatch tests only that key. Plug.MethodOverride evaluates body_params[\"_method\"] on every POST. For a struct, Access.get/3 calls fetch/2 on the named module. Ecto.Query.DynamicExpr does not define fetch/2, so the call raises UndefinedFunctionError, and the top stack frame holds the decoded struct as an argument.\n\n3. Inspect dispatch. Error reporting calls inspect/1 on the request data and on the stack frame arguments (Sentry, the Bandit error log through Exception.format/3, and the JSON log formatter). inspect/1 selects Inspect.Ecto.Query.DynamicExpr, which calls Enum.map/2 on the binding field without a check that the field is a list.\n\n4. Enumerable dispatch. The binding field holds a DBConnection.Stream struct. Its Enumerable implementation calls DBConnection.reduce/3, which takes conn, query, params and opts from the struct and calls declare/4.\n\n5. Function call. declare/4 reads the :log option from opts. Query encoding fails before a connection is checked out, and the error path still calls the log hook. For a {module, function, args} tuple the hook is apply(mod, fun, [entry | args]). All three values come from the request body. The log entry takes the first argument position, so the request names an OTP standard library function that applies a trailing module, function and argument list. The inner call runs an operating system command as the user of the BEAM process.\n\nThe Inspect implementation of a struct runs inside a rescue in Inspect.Algebra, so the request ends with the ordinary 500 response for the Plug.MethodOverride error.\n\nThe fix makes HexpmWeb.ErlangFormat.decode/1 return an error when any map in the decoded term has a __struct__ key. The parser turns that error into a 400 response."}]}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-129514","datePublished":"2026-11-24T13:48:12.692Z","dateReserved":"2026-11-16T02:00:55.789Z","dateUpdated":"2026-11-24T13:48:12.692Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}