The vulnerability, identified as GHSA-j9cw-hwqf-85w7, is a Denial of Service (DoS) caused by improper handling of highly compressed data, commonly known as a "gzip bomb." The root cause is the lack of size limits on decompressed data within Fluentd's in_http and in_forward plugins, as well as in the buffer processing logic.
The analysis of the patch commit 2cdbce70a7ddf584360a9a4ac8c12d4ce095961d reveals that the core issue was in multiple locations where gzip, zstd, or deflate decompression was performed without validating the output size against a limit.
-
in_http Plugin: The on_message_complete method in the HttpInput::Handler class directly used Zlib::GzipReader.new(...).read to decompress the entire request body in one go. This is a direct vector for a DoS attack.
-
in_forward Plugin: The on_message method in the ForwardInput class would receive compressed data and wrap it in a CompressedMessagePackEventStream. The actual decompression was deferred until this stream was read, at which point the vulnerable Compressable.string_decompress method was called, again leading to unbounded memory allocation.
-
Buffer Chunks: Compressed data can also reside in buffers on disk or in memory. When these chunks were read via methods like Buffer::Chunk.read, they would be decompressed using the same vulnerable, unbounded decompression logic.
The patch remediates this vulnerability by introducing a new Fluent::Plugin::Extractor module. This module provides safe decompression methods (decompress_gzip, decompress_zstd, etc.) that read data in small chunks and continuously check the total decompressed size against a configurable decompression_size_limit. The vulnerable parts of the codebase in in_http, in_forward, and the buffer-related classes were then updated to use this new safe extractor, effectively mitigating the DoS risk.