CVE-2026-59406

Denial of Service
Affects
Spring for Apache Kafka
in
Spring
No items found.
Versions
<=2.8.13, >=2.9.0 <=2.9.15, >=3.0.0 <=3.3.17, >=4.0.0 <=4.0.8, >=4.1.0 <=4.1.2

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring for Apache Kafka is the Spring project that applies core Spring concepts to building Kafka-based messaging applications, providing a template for sending records and message-driven listeners such as @KafkaListener for consuming them.

A denial of service vulnerability (CVE-2026-59406) has been identified in the Kafka header mappers of Spring for Apache Kafka, which allows attackers who can produce records to a consumed topic to make the consumer allocate memory sized by a header value. A small malicious record can exhaust the heap or raise an OutOfMemoryError that stops the listener container, repeatedly halting consumption.

Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.

This issue affects multiple versions of Spring for Apache Kafka.

Details

Module Info

Vulnerability Info

This Medium-severity vulnerability is found in the org.springframework.kafka:spring-kafka package in multiple versions of Spring for Apache Kafka. When mapping inbound record headers, DefaultKafkaHeaderMapper (and, from 4.0, JsonKafkaHeaderMapper), which the default messaging message converters use for @KafkaListener methods, deserializes each header value into the class named for that header in the producer-controlled spring_json_header_types header, provided the class's package is trusted. The default trusted packages include org.springframework.util, and the small deny list of never-trusted types, where a release has one, covers only java.net address types:

private static final List<String> DEFAULT_TRUSTED_PACKAGES = List.of(
        "java.lang",
        "java.net",
        "java.util",
        "org.springframework.util"
);

private static final Set<String> UNTRUSTED_TYPES = new HashSet<>(Arrays.asList(
        "java.net.InetAddress",
        "java.net.Inet4Address",
        "java.net.Inet6Address",
        "java.net.InetSocketAddress"
));

A trusted type is then passed straight to Jackson:

Object value = headerObjectMapper.readValue(h.value(), type);

A producer can therefore declare org.springframework.util.ResizableByteArrayOutputStream or org.springframework.util.ConcurrentReferenceHashMap as a header's type and send a number such as 2147483647 as its value. Jackson builds the object through its single-integer constructor, so the consumer allocates a buffer or table of that size while mapping the header. With Jackson 3, a single large header raises an OutOfMemoryError that the mapper does not catch, so the listener container stops before the record is committed and stops again on the same record after a restart. With Jackson 2, one record carrying many such headers can exhaust the heap with the same result. Any application that consumes from a topic an attacker can produce to, and maps headers with these mappers, is exposed.

Mitigation

Only recent versions of Spring for Apache Kafka receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to a currently supported version of Spring for Apache Kafka.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2026-59406
PROJECT Affected
Spring for Apache Kafka
Versions Affected
<=2.8.13, >=2.9.0 <=2.9.15, >=3.0.0 <=3.3.17, >=4.0.0 <=4.0.8, >=4.1.0 <=4.1.2
NES Versions Affected
Published date
November 20, 2026
≈ Fix date
Category
Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.