Apache Software Foundation Apache Kafka unbounded decompressed-record allocation causes denial of service

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-114349?

CVE-2026-114349 is a vulnerability classified as Memory Allocation with Excessive Size Value, Uncontrolled Resource Consumption, and Improper Validation of Specified Quantity in Input, affecting Apache Kafka (affected versions: 0.11.0.0 – < 2.5.0, 0.11.0.0 – < 4.0.0, and other affected versions). This vulnerability is rated Medium, with a CVSS score of 6.5. Current sources do not report this vulnerability as exploited.

Overview

Original source data

When a broker decodes a compressed record batch, the per-record decoder reads a declared body size from the decompressed stream and allocates a buffer of that size before validating it against the bytes available or any configured limit. The size is attacker-controlled, and the batch CRC does not constrain it, so a small (around 90-byte), CRC-valid compressed produce request can declare a body size of up to about 2 GiB and force the broker to attempt that allocation, raising OutOfMemoryError. The record size limit (max.message.bytes), the request size limit, and client/broker quotas bound only the compressed wire size, not the declared decompressed size.

Impact: An authenticated principal with Write on a topic can crash broker request-handler threads (reached when a batch's codec differs from the topic's compression.type and records are re-encoded) and any consumer that fetches the record, denying service. On brokers started with -XX:+ExitOnOutOfMemoryError, a common hardening, a single crafted request terminates the broker JVM. More seriously, a crafted record is accepted at ingest and written to disk; when the log-cleaner later reads it on a compacted topic, the OutOfMemoryError (an Error, not an Exception) terminates the cleaner thread, which is not restarted. With the default of a single cleaner thread, log compaction then stops for the entire broker, including the internal __consumer_offsets and __transaction_state topics, and the condition persists across restarts until the offending record is removed. The impact is availability only; no data is disclosed or altered.

Mitigation: Upgrade to Apache Kafka 4.2.2, 4.3.2, or 4.4.0, and set max.decompressed.message.bytes (at the broker and/or topic level) to a bounded value appropriate for your workload. Upgrading alone is not sufficient: for backward compatibility this configuration defaults to an effectively unlimited value (about 2 GiB), so a broker remains exposed until the limit is set. Choose a value at or slightly above the largest legitimate decompressed record your applications produce, and comfortably below the broker heap divided by the number of request-handler and cleaner threads. Until you can upgrade and configure the limit, restrict Write access to trusted producers; quotas and max.message.bytes do not mitigate this issue.

Resolution: From Apache Kafka 4.2.2, 4.3.2, and 4.4.0: the broker validates a record's declared decompressed body size against max.decompressed.message.bytes before allocating, on the produce-validation, log-compaction, and timestamp-lookup paths, and rejects oversized or negative sizes with InvalidRecordException. Operators must set this configuration to a bounded value to be protected, as its default is effectively unlimited.

Affected products and scope

  • org.apache.kafka:kafka_2.11: affected from 0.11.0.0 through but not including 2.5.0.
  • org.apache.kafka:kafka_2.12: affected from 0.11.0.0 through but not including 4.0.0.
  • org.apache.kafka:kafka_2.13: affected from 2.4.0 through 4.1.2, from 4.2.0 through 4.2.1, and from 4.3.0 through 4.3.1.
  • The Apache Kafka advisory summarizes the affected releases as 0.11.0.0 through 4.1.2, 4.2.0 through 4.2.1, and 4.3.0 through 4.3.1. It lists 4.2.2, 4.3.2, and 4.4.0 as fixed versions.
  • The record does not separately establish the status of every later or parallel release branch or artifact beyond these ranges; safety should not be inferred for unverified branches.

Technical details

The flaw is in broker-side decoding of compressed record batches. The per-record decoder reads a declared body size from the decompressed stream and allocates a buffer of that size before checking the bytes actually available or any configured limit. The size is attacker-controlled, while the batch CRC does not constrain it, so a small but CRC-valid compressed produce request can declare a body size of up to about 2 GiB and force the broker to attempt that allocation. max.message.bytes, request-size limits, and client or broker quotas constrain only the compressed wire size, not the declared decompressed size. The dangerous paths include re-encoding when a batch codec differs from the topic's compression.type, consumer fetch processing, log compaction, and timestamp lookup. The available evidence does not identify the precise implementation class, function, or file responsible for the unchecked allocation.

Exploitability

  • The issue is network-reachable for an authenticated principal with Write permission on a topic; no user interaction is required.
  • The normalized record characterizes the attack complexity as low and identifies a crafted compressed produce request with an attacker-controlled decompressed body size as the key condition.
  • Effects can occur when the broker decodes the batch, when a consumer fetches the record, or when the log cleaner processes it on a compacted topic. Which paths are reached depends on deployment configuration and activity.
  • The normalized record marks public exploit as false but leaves known exploitation unspecified. That status does not prove that exploitation has not occurred.

Technical impact

The flaw lets an authenticated network principal with Write permission consume excessive memory in a broker or consumer by declaring a decompressed body size larger than the available data. The technical result is OutOfMemoryError, which can stop a request-handler thread, a consumer processing the record, the broker JVM under the stated hardening condition, or a log-cleaner thread that is not restarted. On compacted topics, cleaner termination can stop compaction across the broker and affect the internal topics named in the record; the condition can survive restarts until the offending record is removed. The established impact is availability only, with no established confidentiality or integrity impact. Exploitability depends on write authorization, the batch codec and topic compression.type, consumer fetch activity, and whether compaction or timestamp-lookup paths process the record.

Business impact

  • An authenticated producer with Write permission can crash request-handler threads or consumers fetching the record, disrupting produce, consume, or request processing.
  • If the JVM is started with -XX:+ExitOnOutOfMemoryError, one crafted request can terminate the broker JVM.
  • On a compacted topic, the crafted record can be written to disk before the log cleaner reads it and its cleaner thread terminates. With the default of one cleaner thread, log compaction can stop for the entire broker, including __consumer_offsets and __transaction_state.
  • The compaction condition can persist across restarts until the offending record is removed.
  • The record establishes availability impact only; it does not establish disclosure or alteration of data.

Remediation

  1. Upgrade Apache Kafka to a fixed release appropriate for the supported branch: 4.2.2, 4.3.2, or 4.4.0. Do not treat upgrading alone as sufficient.
  2. Set max.decompressed.message.bytes at broker and or topic scope to a finite value appropriate for the workload. For backward compatibility, this configuration defaults to an effectively unlimited value, so the broker remains exposed until the limit is set.
  3. Choose a value at or slightly above the largest legitimate decompressed record produced by the applications, and comfortably below the broker heap divided by the number of request-handler and cleaner threads.
  4. Until both upgrade and configuration are possible, restrict Write permission to trusted producers. Quotas and max.message.bytes do not mitigate this issue.
  5. In the fixed releases, the broker checks the declared decompressed body size against max.decompressed.message.bytes before allocation on the produce-validation, log-compaction, and timestamp-lookup paths, and rejects oversized or negative sizes with InvalidRecordException. Operators must still set a finite value to be protected.

Detection

  • Inventory brokers and the Maven artifacts org.apache.kafka:kafka_2.11, org.apache.kafka:kafka_2.12, and org.apache.kafka:kafka_2.13; compare deployed releases with the affected and fixed boundaries in affected_summary.
  • Check max.decompressed.message.bytes at broker and topic scope. It should be explicitly bounded for the workload rather than left at an effectively unlimited default.
  • Review compacted topics, each topic's compression.type, and producer Write permissions because these are relevant to the processing paths described for the flaw.
  • Review telemetry and logs for OutOfMemoryError, failed request-handler threads, JVM exits associated with -XX:+ExitOnOutOfMemoryError, a terminated log-cleaner thread, or halted compaction. These are impact-consistent symptoms, not confirmed attack-specific IOCs.
  • Verify compaction status after broker restart. Compaction that remains stopped until the offending record is removed is a condition requiring investigation; the absence of these symptoms or log entries does not prove that the broker is safe.
Sources (12)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.