Spring-Kafka has Java Deserialization vulnerability When Improperly Configured
In Spring for Apache Kafka 3.0.9 and earlier and versions 2.9.10 and earlier, a possible deserialization attack vector existed, but only if unusual configuration was applied. An attacker would have to construct a malicious serialized object in one of the deserialization exception record headers.
Specifically, an application is vulnerable when all of the following are true:
- The user does not configure an ErrorHandlingDeserializer for the key and/or value of the record
- The user explicitly sets container properties checkDeserExWhenKeyNull and/or checkDeserExWhenValueNull container properties to true.
- The user allows untrusted sources to publish to a Kafka topic
By default, these properties are false, and the container only attempts to deserialize the headers if an ErrorHandlingDeserializer is configured. The ErrorHandlingDeserializer prevents the vulnerability by removing any such malicious headers before processing the record.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.springframework.kafka:spring-kafka | >= 2.8.1, < 2.9.11, >= 3.0.0, < 3.0.10 | 2.9.11, 3.0.10 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-34040
- https://github.com/spring-projects/spring-kafka/commit/25ac793a78725e2ca4a3a2888a1506a4bfcf0c9d
- https://github.com/spring-projects/spring-kafka/commit/eb779679812f61a8553ced3d0e4069dca65560ed
- https://github.com/spring-projects/spring-kafka
- https://spring.io/security/cve-2023-34040
- CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-502- Platform
- Java / Kotlin (Maven)
- Package
org.springframework.kafka:spring-kafka- Disclosed
- 24.08.2023
- Updated
- 11.10.2026 12:21
Sources and licenses
OSV / GitHub Advisory Database - GHSA-crqf-q9fp-hwjw - CC BY 4.0
Vulnerability history: org.springframework.kafka:spring-kafka
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 4
- First → latest
- 08.2023 06.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 2
- Medium 2
Disclosures per year
- 2023: 1
- 2024: 0
- 2025: 0
- 2026: 3
-
Spring-Kafka has Java Deserialization vulnerability When Improperly Configured this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.