Netty HttpContentDecompressor Brotli/Zstd/Snappy Decompression Bomb Vulnerability
Netty's HttpContentDecompressor and DelegatingDecompressorFrameListener are vulnerable to a decompression bomb denial-of-service attack because the maxAllocation parameter is not enforced when Content-Encoding is set to br (Brotli), zstd, or snappy, allowing attackers to bypass decompression limits and cause unbounded memory allocation.
The Netty framework is susceptible to a decompression bomb vulnerability in its HttpContentDecompressor and DelegatingDecompressorFrameListener components. This flaw, present in versions up to 4.2.12.Final and 4.1.132.Final, arises because the maxAllocation parameter, intended to limit decompression buffer size, is ignored when content is encoded using Brotli (br), Zstandard (zstd), or Snappy. An attacker can exploit this by sending a specially crafted compressed payload with a Content-Encoding header set to one of the affected algorithms. This circumvents the configured memory limits, leading to excessive memory allocation and ultimately causing an out-of-memory denial-of-service (DoS) condition on the server. The vulnerability affects both HTTP/1.1 and HTTP/2 connections.
Attack Chain
- The attacker identifies a Netty-based HTTP server that uses
HttpContentDecompressororDelegatingDecompressorFrameListenerwith a configuredmaxAllocationvalue. - The attacker crafts a malicious compressed payload designed to expand dramatically upon decompression (a “decompression bomb”). For example, a small compressed file expands to gigabytes of zeros.
- The attacker sets the
Content-EncodingHTTP header tobr,zstd, orsnappy. - The attacker sends an HTTP POST request to the vulnerable server, including the malicious compressed payload in the request body.
- The server receives the request and
HttpContentDecompressororDelegatingDecompressorFrameListenerprocesses the request, detects theContent-Encoding, and attempts to decompress it using the corresponding decoder (BrotliDecoder,ZstdDecoder, orSnappyFrameDecoder). - Because the
maxAllocationis not enforced for these decoders, decompression proceeds without memory limits. - The decoder allocates memory to store the decompressed data, which rapidly consumes available memory.
- The server runs out of memory, causing a denial-of-service condition for legitimate users.
Impact
Successful exploitation of this vulnerability leads to a denial-of-service condition on the targeted Netty server. This can disrupt services, cause downtime, and impact legitimate users. Organizations using affected versions of Netty are vulnerable to this attack. Developers may have a false sense of security, believing that maxAllocation protects them from all decompression bombs, but are unknowingly exposed when using brotli, zstd, or snappy encodings. A trivial header modification bypasses the intended protection.
Recommendation
- Upgrade to a patched version of Netty that addresses CVE-2026-42587.
- Apply the recommended fix by passing
maxAllocationto all decoder constructors, includingBrotliDecoder,SnappyFrameDecoder, andZstdDecoder, as outlined in the advisory. - For
BrotliDecoderandSnappyFrameDecoder, implementmaxAllocationparameter with the same semantics asZlibDecoder.prepareDecompressBuffer(). - For
ZstdDecoder, ensure that whenmaxAllocationis set, total output across all buffers is bounded. - Implement a network-level rule to limit the size of compressed requests based on
Content-Encodingheader and request size to mitigate potential decompression attacks even if the application is vulnerable.
Detection coverage 3
Detect HTTP Request with Brotli Content-Encoding
lowDetects HTTP requests with Brotli content encoding, which might indicate attempts to exploit the decompression vulnerability.
Detect HTTP Request with Zstd Content-Encoding
lowDetects HTTP requests with Zstd content encoding, which might indicate attempts to exploit the decompression vulnerability.
Detect HTTP Request with Snappy Content-Encoding
lowDetects HTTP requests with Snappy content encoding, which might indicate attempts to exploit the decompression vulnerability.
Detection queries are kept inside the platform. Get full rules →