In Spring for Apache Kafka, DelegatingDeserializer allows header-driven arbitrary class loading and deserializer selection

MEDIUM | NOVEMBER 19, 2026 | CVE-2026-59399

Description

DelegatingDeserializer selects the delegate deserializer for each record from the spring.kafka.serialization.selector (value) or spring.kafka.key.serialization.selector (key) header. When the selector matched no configured delegate, it loaded the class named in the header, without any restriction, and, for a type supported by Kafka's Serdes (such as String or Long), deserialized the record with the corresponding standard deserializer.

Since the producer sets the header, a malicious producer can choose how records are deserialized, regardless of the configured delegates, so that listeners receive data of an unexpected type, and can make the consumer load any class on its classpath. Combined with the selection of the configured delegates by the same header, this can let an attacker apply a delegate to data it was not intended for.

An application is affected if it consumes records from a topic that an attacker can produce to and uses DelegatingDeserializer as the key or value deserializer.

Affected Spring Products and Versions

Spring for Apache Kafka:

  • 4.1.0 - 4.1.2
  • 4.0.0 - 4.0.8
  • 3.0.0 - 3.3.17
  • 2.9.0 - 2.9.15
  • 2.8.13 and earlier

Mitigation

Users of affected versions should upgrade to the corresponding fixed version.
Fix versionAvailability
4.1.3OSS
4.1.2.1Enterprise Support Only
4.0.9OSS
4.0.8.1Enterprise Support Only
3.3.18Enterprise Support Only
2.9.16Enterprise Support Only
2.8.14Enterprise Support Only

Users of affected versions should upgrade to the corresponding fixed version.

In the fixed versions, DelegatingDeserializer only uses the configured delegates and returns the raw byte[] when the selector matches none of them; it no longer creates deserializers for the standard Serdes types named in the header. Applications that relied on that behavior should configure delegates using the class names as selectors, for example java.lang.Long:org.apache.kafka.common.serialization.LongDeserializer. Because the producer of each record selects which of the configured delegates is applied to its data, only configure delegates that are safe to use with any data that can be published to the topic.

Credit

This vulnerability was discovered and responsibly reported by Yu Bao from PayPal Cyber Security Team.

History

  • 2026-11-19: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

TrueSource Spring Enterprise offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all