2026-11-24 13:48CVE-2026-129514EEF
PUBLISHED5.2ApplicationCWE-502

Unauthenticated remote code execution through struct values in Erlang term request bodies

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.

Problem type

Affected products

hexpm

hexpm

< 2026-11-23 - AFFECTED

hexpm

< 379b0a29bcc95164249f38ad7d772a37a8ff9533 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-129514
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-129514",
    "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
    "assignerShortName": "EEF",
    "dateUpdated": "2026-11-24T13:48:12.692Z",
    "dateReserved": "2026-11-16T02:00:55.789Z",
    "datePublished": "2026-11-24T13:48:12.692Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "shortName": "EEF",
        "dateUpdated": "2026-11-24T13:48:12.692Z"
      },
      "datePublic": "2026-11-23T18:26:41.000Z",
      "title": "Unauthenticated remote code execution through struct values in Erlang term request bodies",
      "descriptions": [
        {
          "lang": "en",
          "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.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "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>"
            },
            {
              "type": "text/markdown",
              "base64": false,
              "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."
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "hexpm",
          "product": "hexpm",
          "collectionURL": "https://hex.pm",
          "packageName": "hex.pm",
          "cpes": [
            "cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*"
          ],
          "modules": [
            "'Elixir.HexpmWeb.ErlangFormat'",
            "'Elixir.HexpmWeb.PlugParser'"
          ],
          "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"
            }
          ],
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "2016-02-23",
              "status": "affected",
              "versionType": "date",
              "lessThan": "2026-11-23"
            }
          ]
        },
        {
          "vendor": "hexpm",
          "product": "hexpm",
          "collectionURL": "https://github.com",
          "packageName": "hexpm/hexpm",
          "cpes": [
            "cpe:2.3:a:hexpm:hexpm:*:*:*:*:*:*:*:*"
          ],
          "modules": [
            "'Elixir.HexpmWeb.ErlangFormat'",
            "'Elixir.HexpmWeb.PlugParser'"
          ],
          "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",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "ab1bbcef7cc8395d1056d3b1aa6a174353492d59",
              "status": "affected",
              "versionType": "git",
              "lessThan": "379b0a29bcc95164249f38ad7d772a37a8ff9533"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-502 Deserialization of Untrusted Data",
              "cweId": "CWE-502",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/hexpm/hexpm/security/advisories/GHSA-9pmm-hf4r-27pg",
          "name": "Unauthenticated remote code execution through struct values in Erlang term request bodies",
          "tags": [
            "vendor-advisory",
            "related"
          ]
        },
        {
          "url": "https://cna.erlef.org/cves/CVE-2026-129514.html",
          "name": "EEF CNA record for CVE-2026-129514",
          "tags": [
            "related"
          ]
        },
        {
          "url": "https://osv.dev/vulnerability/EEF-CVE-2026-129514",
          "name": "OSV record EEF-CVE-2026-129514",
          "tags": [
            "related"
          ]
        },
        {
          "url": "https://github.com/hexpm/hexpm/commit/ab1bbcef7cc8395d1056d3b1aa6a174353492d59",
          "name": "Introducing commit ab1bbce in hexpm/hexpm",
          "tags": [
            "related"
          ]
        },
        {
          "url": "https://github.com/hexpm/hexpm/commit/379b0a29bcc95164249f38ad7d772a37a8ff9533",
          "name": "Fix commit 379b0a2 in hexpm/hexpm",
          "tags": [
            "patch"
          ]
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-586",
          "descriptions": [
            {
              "lang": "en",
              "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.",
              "supportingMedia": [
                {
                  "type": "text/html",
                  "base64": false,
                  "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>"
                },
                {
                  "type": "text/markdown",
                  "base64": false,
                  "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": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Eric Meadows-Jönsson",
          "type": "analyst"
        },
        {
          "lang": "en",
          "value": "Jonatan Männchen / EEF",
          "type": "analyst"
        },
        {
          "lang": "en",
          "value": "Peter Ullrich",
          "type": "analyst"
        },
        {
          "lang": "en",
          "value": "Wojtek Mach",
          "type": "analyst"
        },
        {
          "lang": "en",
          "value": "Jonatan Männchen / EEF",
          "type": "coordinator"
        },
        {
          "lang": "en",
          "value": "Eric Meadows-Jönsson",
          "type": "remediation developer"
        }
      ]
    }
  }
}