Memory Allocation with Excessive Size Value Affecting org.springframework.kafka:spring-kafka package, versions [,4.0.9)[4.1.0-M1,4.1.3)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGSPRINGFRAMEWORKKAFKA-22729381
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditJIHUN KIM

Introduced: 19 Nov 2026

NewCVE-2026-59406  (opens in a new tab)
CWE-789  (opens in a new tab)

How to fix?

Upgrade org.springframework.kafka:spring-kafka to version 4.0.9, 4.1.3 or higher.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the DefaultKafkaHeaderMapper and JsonKafkaHeaderMapper classes, which deserialize an inbound header into a type named by the producer-controlled spring_json_header_types header, trusting org.springframework.util by default. An attacker who can produce to a consumed topic can name org.springframework.util.ResizableByteArrayOutputStream with a large numeric value to allocate a buffer of that size, exhausting the heap: with Jackson 3 a single header raises an uncaught OutOfMemoryError that halts the listener, and with Jackson 2 one record with many such headers exhausts memory. This requires the application to map inbound headers with one of these mappers, which is the default for @KafkaListener and listeners using the messaging message converters.

CVSS Base Scores

version 4.0
version 3.1