CVE-2026-59406: In Spring for Apache Kafka, denial of service via memory-allocating types in header mapper default trusted packages
When mapping inbound record headers, JsonKafkaHeaderMapper and DefaultKafkaHeaderMapper (used by the default message converters) deserialize each header value into the type named for it in the producer-controlled springjsonheadertypes header, provided that type's package is trusted. Because org.springframework.util is trusted by default, a producer can declare org.springframework.util.ResizableByteArrayOutputStream and supply a number as the header value, causing the consumer to allocate a buffer of that size while mapping the header.
With Jackson 3, a single header with a large value raises an OutOfMemoryError that is not caught by the mapper, so the listener container stops before the record is committed, and stops again on the same record after a restart. With Jackson 2, a single record carrying many such headers can exhaust the heap with the same result. In both cases, a small record is enough for a malicious producer to repeatedly stop consumption and put memory pressure on the whole application.
An application is affected if it consumes records from a topic that an attacker can produce to and maps headers with JsonKafkaHeaderMapper or DefaultKafkaHeaderMapper , which is the default for @KafkaListener methods and other listeners using the messaging message converters.
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
An application is affected when it consumes from a topic to which an attacker can produce records and maps record headers using JsonKafkaHeaderMapper or DefaultKafkaHeaderMapper. These mappers are used by the default message converters.
Does the default trusted-package configuration permit exploitation?
Yes. The org.springframework.util package is trusted by default, allowing a producer to specify org.springframework.util.ResizableByteArrayOutputStream in the producer-controlled spring_json_header_types header.
What level of access does an attacker need?
The attacker needs the ability to produce records to a topic consumed by the vulnerable application. No user interaction is required.
How does the denial of service differ between Jackson 2 and Jackson 3?
With Jackson 3, one header carrying a large numeric value can cause an uncaught OutOfMemoryError. With Jackson 2, a single record containing many such headers can exhaust heap memory; in either case, the listener can repeatedly stop on the same uncommitted record after restart.