{"id":"CVE-2026-121808","state":"PUBLISHED","title":"Memory exhaustion via compressed Erlang terms in the elixir-grpc Erlpack codec","description":"Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in elixir-grpc grpc_core and grpc allows unauthenticated attackers to exhaust server memory via a compressed Erlang external term in a gRPC message body.\n\nGRPC.Codec.Erlpack.decode/2 (grpc_core/lib/grpc/codec/erlpack.ex, and lib/grpc/codec/erlpack.ex before the package split) passes the message body to :erlang.binary_to_term/2. That function inflates a compressed term in full before it returns. The codec sets no limit on the decoded size, and its type checks run only on the decoded term. The server's max_body_size limit counts the compressed bytes of the request. A request with Content-Type: application/grpc+erlpack can therefore make the server allocate a term much larger than the request body.\n\nThis issue affects grpc: from 0.4.0 before 1.0.0; grpc_core: from 1.0.0 before 1.1.0.","publishedAt":"2026-11-13T15:48:49.871Z","updatedAt":"2026-11-20T05:56:02.779Z","severity":{"score":8.2,"label":"High","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","source":"EEF"},"assigner":"EEF","products":["elixir-grpc grpc","elixir-grpc grpc_core"],"affected":[{"vendor":"elixir-grpc","product":"grpc","packageName":"grpc","packageURL":"pkg:hex/grpc","defaultStatus":"unaffected","versions":[{"version":"0.4.0","status":"affected","lessThan":"1.0.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc","packageName":"elixir-grpc/grpc","packageURL":"pkg:github/elixir-grpc/grpc","defaultStatus":"unaffected","versions":[{"version":"25bcc569fe2cc4478531a6c546c923205fc751c9","status":"affected","lessThan":"0332faae5f5e132314794dbfdae5edecbccea292","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc_core","packageName":"grpc_core","packageURL":"pkg:hex/grpc_core","defaultStatus":"unaffected","versions":[{"version":"1.0.0","status":"affected","lessThan":"1.1.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-grpc:grpc_core:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc_core","packageName":"elixir-grpc/grpc","packageURL":"pkg:github/elixir-grpc/grpc","defaultStatus":"unaffected","versions":[{"version":"0332faae5f5e132314794dbfdae5edecbccea292","status":"affected","lessThan":"d6bc56ac75dfb6c02db2099909210a37c9be8db6","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-grpc:grpc_core:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["grpc_core/lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"}],"references":["https://github.com/elixir-grpc/grpc/security/advisories/GHSA-xxp9-7hp4-rqwp","https://cna.erlef.org/cves/CVE-2026-121808.html","https://osv.dev/vulnerability/EEF-CVE-2026-121808","https://github.com/elixir-grpc/grpc/commit/25bcc569fe2cc4478531a6c546c923205fc751c9","https://github.com/elixir-grpc/grpc/commit/0332faae5f5e132314794dbfdae5edecbccea292","https://github.com/elixir-grpc/grpc/commit/d6bc56ac75dfb6c02db2099909210a37c9be8db6"],"weaknesses":["CWE-409"],"ingestedAt":"2026-11-20T06:02:06.774Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/121xxx/CVE-2026-121808.json","commit":"286644975f512438dcd923d6461796166c4dad87","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-121808","state":"PUBLISHED","datePublished":"2026-11-13T15:48:49.871Z","dateUpdated":"2026-11-20T05:56:02.779Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-11-09T22:35:50.462Z"},"containers":{"cna":{"title":"Memory exhaustion via compressed Erlang terms in the elixir-grpc Erlpack codec","descriptions":[{"lang":"en","value":"Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in elixir-grpc grpc_core and grpc allows unauthenticated attackers to exhaust server memory via a compressed Erlang external term in a gRPC message body.\n\nGRPC.Codec.Erlpack.decode/2 (grpc_core/lib/grpc/codec/erlpack.ex, and lib/grpc/codec/erlpack.ex before the package split) passes the message body to :erlang.binary_to_term/2. That function inflates a compressed term in full before it returns. The codec sets no limit on the decoded size, and its type checks run only on the decoded term. The server's max_body_size limit counts the compressed bytes of the request. A request with Content-Type: application/grpc+erlpack can therefore make the server allocate a term much larger than the request body.\n\nThis issue affects grpc: from 0.4.0 before 1.0.0; grpc_core: from 1.0.0 before 1.1.0."}],"affected":[{"vendor":"elixir-grpc","product":"grpc","packageName":"grpc","packageURL":"pkg:hex/grpc","defaultStatus":"unaffected","versions":[{"version":"0.4.0","status":"affected","lessThan":"1.0.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc","packageName":"elixir-grpc/grpc","packageURL":"pkg:github/elixir-grpc/grpc","defaultStatus":"unaffected","versions":[{"version":"25bcc569fe2cc4478531a6c546c923205fc751c9","status":"affected","lessThan":"0332faae5f5e132314794dbfdae5edecbccea292","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc_core","packageName":"grpc_core","packageURL":"pkg:hex/grpc_core","defaultStatus":"unaffected","versions":[{"version":"1.0.0","status":"affected","lessThan":"1.1.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-grpc:grpc_core:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"},{"vendor":"elixir-grpc","product":"grpc_core","packageName":"elixir-grpc/grpc","packageURL":"pkg:github/elixir-grpc/grpc","defaultStatus":"unaffected","versions":[{"version":"0332faae5f5e132314794dbfdae5edecbccea292","status":"affected","lessThan":"d6bc56ac75dfb6c02db2099909210a37c9be8db6","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-grpc:grpc_core:*:*:*:*:*:*:*:*"],"modules":["'Elixir.GRPC.Codec.Erlpack'"],"programFiles":["grpc_core/lib/grpc/codec/erlpack.ex"],"programRoutines":[{"name":"'Elixir.GRPC.Codec.Erlpack':decode/2"}],"repo":"https://github.com/elixir-grpc/grpc"}],"references":[{"url":"https://github.com/elixir-grpc/grpc/security/advisories/GHSA-xxp9-7hp4-rqwp","name":"Memory exhaustion via compressed Erlang terms in the elixir-grpc Erlpack codec","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-121808.html","name":"EEF CNA record for CVE-2026-121808","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-121808","name":"OSV record EEF-CVE-2026-121808","tags":["related"]},{"url":"https://github.com/elixir-grpc/grpc/commit/25bcc569fe2cc4478531a6c546c923205fc751c9","name":"Introducing commit 25bcc56 in elixir-grpc/grpc","tags":["related"]},{"url":"https://github.com/elixir-grpc/grpc/commit/0332faae5f5e132314794dbfdae5edecbccea292","name":"Fix commit 0332faa in elixir-grpc/grpc","tags":["patch"]},{"url":"https://github.com/elixir-grpc/grpc/commit/d6bc56ac75dfb6c02db2099909210a37c9be8db6","name":"Fix commit d6bc56a in elixir-grpc/grpc","tags":["patch"]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":8.2,"baseSeverity":"HIGH","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-409","description":"CWE-409 Improper Handling of Highly Compressed Data (Data Amplification)","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-11-20T05:56:02.779Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><code>GRPC.Codec.Erlpack</code> must be explicitly registered as a codec on the gRPC server.</p>"},{"base64":false,"type":"text/markdown","value":"`GRPC.Codec.Erlpack` must be explicitly registered as a codec on the gRPC server."}],"value":"GRPC.Codec.Erlpack must be explicitly registered as a codec on the gRPC server."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*","versionEndExcluding":"1.0.0","versionStartIncluding":"0.4.0","vulnerable":true},{"criteria":"cpe:2.3:a:elixir-grpc:grpc_core:*:*:*:*:*:*:*:*","versionEndExcluding":"1.1.0","versionStartIncluding":"1.0.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Han Dai"},{"lang":"en","type":"finder","value":"Hongwei Li"},{"lang":"en","type":"finder","value":"Jiacheng Zhong"},{"lang":"en","type":"finder","value":"Junmin Zhu"},{"lang":"en","type":"finder","value":"Songyang Peng"},{"lang":"en","type":"finder","value":"Suyue Guo"},{"lang":"en","type":"finder","value":"Zhun Wang"},{"lang":"en","type":"finder","value":"Ziyue Pan"},{"lang":"en","type":"finder","value":"zx"},{"lang":"en","type":"reporter","value":"Hongwei Li"},{"lang":"en","type":"reporter","value":"Jace"},{"lang":"en","type":"reporter","value":"zx"},{"lang":"en","type":"coordinator","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"coordinator","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Paulo Valente"}],"dateAssigned":"2026-11-12T20:11:46.000Z","datePublic":"2026-11-13T15:48:50.000Z","impacts":[{"capecId":"CAPEC-130","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An unauthenticated client can make a server that registers the Erlpack codec allocate memory far beyond the size of the request with one request. Memory exhaustion affects every service on that node.</p>"},{"base64":false,"type":"text/markdown","value":"An unauthenticated client can make a server that registers the Erlpack codec allocate memory far beyond the size of the request with one request. Memory exhaustion affects every service on that node."}],"value":"An unauthenticated client can make a server that registers the Erlpack codec allocate memory far beyond the size of the request with one request. Memory exhaustion affects every service on that node."}]}],"source":{"discovery":"EXTERNAL"},"workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Remove <code>GRPC.Codec.Erlpack</code> from the server's <code>codecs</code> list if the codec is not needed.</p>\n<p>If the codec is needed, register a wrapper codec in its place. The wrapper implements the <code>GRPC.Codec</code> behaviour, returns <code>\"erlpack\"</code> from <code>name/0</code>, raises in <code>decode/2</code> when the body starts with the bytes <code>131, 80</code> (the compressed term tag), and delegates all other calls to <code>GRPC.Codec.Erlpack</code>.</p>"},{"base64":false,"type":"text/markdown","value":"Remove `GRPC.Codec.Erlpack` from the server's `codecs` list if the codec is not needed.\n\nIf the codec is needed, register a wrapper codec in its place. The wrapper implements the `GRPC.Codec` behaviour, returns `\"erlpack\"` from `name/0`, raises in `decode/2` when the body starts with the bytes `131, 80` (the compressed term tag), and delegates all other calls to `GRPC.Codec.Erlpack`."}],"value":"Remove GRPC.Codec.Erlpack from the server's codecs list if the codec is not needed.\n\nIf the codec is needed, register a wrapper codec in its place. The wrapper implements the GRPC.Codec behaviour, returns \"erlpack\" from name/0, raises in decode/2 when the body starts with the bytes 131, 80 (the compressed term tag), and delegates all other calls to GRPC.Codec.Erlpack."}],"x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Start a gRPC server that registers <code>GRPC.Codec.Erlpack</code> in its <code>codecs</code> list.</li>\n<li>Build the payload with <code>:erlang.term_to_binary(:binary.copy(&lt;&lt;0&gt;&gt;, 268_435_456), [:compressed])</code>. The result is 260,932 bytes.</li>\n<li>Send the payload as one uncompressed gRPC message (compressed flag 0) to any method of the server, with <code>Content-Type: application/grpc+erlpack</code>.</li>\n<li>Observe that the server allocates the 268,435,456-byte binary and passes it to the application callback.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Start a gRPC server that registers `GRPC.Codec.Erlpack` in its `codecs` list.\n2. Build the payload with `:erlang.term_to_binary(:binary.copy(<<0>>, 268_435_456), [:compressed])`. The result is 260,932 bytes.\n3. Send the payload as one uncompressed gRPC message (compressed flag 0) to any method of the server, with `Content-Type: application/grpc+erlpack`.\n4. Observe that the server allocates the 268,435,456-byte binary and passes it to the application callback."}],"value":"* Start a gRPC server that registers GRPC.Codec.Erlpack in its codecs list.\n* Build the payload with :erlang.term_to_binary(:binary.copy(<<0>>, 268_435_456), [:compressed]). The result is 260,932 bytes.\n* Send the payload as one uncompressed gRPC message (compressed flag 0) to any method of the server, with Content-Type: application/grpc+erlpack.\n* Observe that the server allocates the 268,435,456-byte binary and passes it to the application callback."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Codec selection</strong></p>\n<p>The server selects the codec from the request <code>Content-Type</code>. <code>application/grpc+erlpack</code> selects <code>GRPC.Codec.Erlpack</code> when the server registers it. No authentication step comes before this.</p>\n<p><strong>2. Size limit on compressed bytes only</strong></p>\n<p>The server limits the request body with <code>max_body_size</code>, which counts the bytes received. With the gRPC compressed flag set to 0, the transport decompression limit does not apply, and the message reaches the codec unchanged.</p>\n<p><strong>3. Expansion inside <code>binary_to_term/2</code></strong></p>\n<p><code>GRPC.Codec.Erlpack.decode/2</code> calls <code>:erlang.binary_to_term(binary, [:safe])</code>. The Erlang external term format has a compressed form (version byte 131, tag 80, a 32-bit uncompressed size, then a zlib stream). <code>binary_to_term/2</code> inflates it in full, and the <code>:safe</code> option does not limit the size. <code>ensure_safe_term!/1</code> runs after the call returns and accepts a large binary.</p>\n<p><strong>4. Result</strong></p>\n<p>In a test against grpc_server 1.0.6, a 260,932-byte request body decoded to a 268,435,456-byte binary, which the server passed to the application callback.</p>"},{"base64":false,"type":"text/markdown","value":"**1. Codec selection**\n\nThe server selects the codec from the request `Content-Type`. `application/grpc+erlpack` selects `GRPC.Codec.Erlpack` when the server registers it. No authentication step comes before this.\n\n**2. Size limit on compressed bytes only**\n\nThe server limits the request body with `max_body_size`, which counts the bytes received. With the gRPC compressed flag set to 0, the transport decompression limit does not apply, and the message reaches the codec unchanged.\n\n**3. Expansion inside `binary_to_term/2`**\n\n`GRPC.Codec.Erlpack.decode/2` calls `:erlang.binary_to_term(binary, [:safe])`. The Erlang external term format has a compressed form (version byte 131, tag 80, a 32-bit uncompressed size, then a zlib stream). `binary_to_term/2` inflates it in full, and the `:safe` option does not limit the size. `ensure_safe_term!/1` runs after the call returns and accepts a large binary.\n\n**4. Result**\n\nIn a test against grpc_server 1.0.6, a 260,932-byte request body decoded to a 268,435,456-byte binary, which the server passed to the application callback."}],"value":"1. Codec selection\n\nThe server selects the codec from the request Content-Type. application/grpc+erlpack selects GRPC.Codec.Erlpack when the server registers it. No authentication step comes before this.\n\n2. Size limit on compressed bytes only\n\nThe server limits the request body with max_body_size, which counts the bytes received. With the gRPC compressed flag set to 0, the transport decompression limit does not apply, and the message reaches the codec unchanged.\n\n3. Expansion inside binary_to_term/2\n\nGRPC.Codec.Erlpack.decode/2 calls :erlang.binary_to_term(binary, [:safe]). The Erlang external term format has a compressed form (version byte 131, tag 80, a 32-bit uncompressed size, then a zlib stream). binary_to_term/2 inflates it in full, and the :safe option does not limit the size. ensure_safe_term!/1 runs after the call returns and accepts a large binary.\n\n4. Result\n\nIn a test against grpc_server 1.0.6, a 260,932-byte request body decoded to a 268,435,456-byte binary, which the server passed to the application callback."}]},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-11-16T22:54:59.075851Z","id":"CVE-2026-121808","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-11-16T23:30:44.628Z"}}]}}}