SEVERITY NOT PROVIDED · CVSS 4.0 EPSS 0.6% · 42th percentile CWE-409

CVE-2026-121808: Memory exhaustion via compressed Erlang terms in the elixir-grpc Erlpack codec

Published 2026-11-13 · Updated 2026-11-25 · Also known as EEF-CVE-2026-121808, GHSA-xxp9-7hp4-rqwp

Summary

An improper handling of highly compressed data vulnerability exists in the elixir-grpc Erlpack codec due to unsafe deserialization of compressed Erlang terms. Engineering and security teams using the affected library versions should update their packages immediately.

Who is affected

Unauthenticated attackers can exploit this vulnerability to trigger memory exhaustion on servers running the elixir-grpc Erlpack codec by sending crafted gRPC messages with compressed Erlang terms. This affects deployments where GRPC.Codec.Erlpack is explicitly registered, allowing small request payloads to inflate into massive memory allocations that impact every service on the node.

Exploitability

The vulnerability is remotely exploitable over a network with low attack complexity and requires low privileges or unauthenticated access, though user interaction is not required. The CVSS 4.0 base score is not computed in the record, but the potential impact focuses heavily on high availability loss with an EPSS score of 0.005 and no known exploitation listed in the CISA KEV database.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Hex grpc >= 0.4.0, < 1.0.0 1.0.0 mix deps.update grpc
Hex grpc_core >= 1.0.0, < 1.1.0 1.1.0 mix deps.update grpc_core

CVSS 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

Attack vectorNetwork
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)None
Integrity (vulnerable system)None
Availability (vulnerable system)High
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Which packages are affected by CVE-2026-121808?

The affected packages are Hex grpc (introduced in version 0.4.0 and fixed in 1.0.0) and Hex grpc_core (introduced in version 1.0.0 and fixed in 1.1.0).

How does the memory exhaustion attack work?

An attacker sends a small request body containing a heavily compressed Erlang external term via Content-Type: application/grpc+erlpack. Because binary_to_term/2 inflates the compressed term fully before size validation runs, it forces the server to allocate massive amounts of memory far exceeding the original request size.

Is there a workaround if updating the packages is not immediately possible?

Yes, you can remove GRPC.Codec.Erlpack from the server's codecs list if it is not needed, or implement a wrapper codec that rejects compressed term tags.

Original advisory description
## Summary 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. `GRPC.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. This issue affects grpc: from 0.4.0 before 1.0.0; grpc_core: from 1.0.0 before 1.1.0. ## Details **1. Codec selection** The 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. **2. Size limit on compressed bytes only** The 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. **3. Expansion inside `binary_to_term/2`** `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. **4. Result** 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. ## Proof of concept 1. Start a gRPC server that registers `GRPC.Codec.Erlpack` in its `codecs` list. 2. Build the payload with `:erlang.term_to_binary(:binary.copy(<<0>>, 268_435_456), [:compressed])`. The result is 260,932 bytes. 3. Send the payload as one uncompressed gRPC message (compressed flag 0) to any method of the server, with `Content-Type: application/grpc+erlpack`. 4. Observe that the server allocates the 268,435,456-byte binary and passes it to the application callback. ## Impact 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. ## Workarounds Remove `GRPC.Codec.Erlpack` from the server's `codecs` list if the codec is not needed. If 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`. ## Configurations `GRPC.Codec.Erlpack` must be explicitly registered as a codec on the gRPC server.

References

Source records: EEF-CVE-2026-121808 (OSV.dev) · EPSS by FIRST, 2026-11-26.