Description
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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Spring | Spring For Apache Kafka | 2.8.x – < 2.9.11, 2.9.x – < 2.9.11, 3.0.x – < 3.0.10 | 2.9.11 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 4 repositories
-
Contrast-Security-OSS/Spring-Kafka-POC-CVE-2023-34040 ★ 46 · Aug 30, 2023
POC for Spring Kafka Deserialization Vulnerability CVE-2023-34040
-
pyn3rd/CVE-2023-34040 ★ 31 · Sep 28, 2023
Spring-Kafka-Deserialization-Remote-Code-Execution
-
huyennhat-dev/cve-2023-34040 ★ 1 · May 27, 2024
-
buiduchoang24/CVE-2023-34040 ★ 0 · Apr 24, 2024
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 t…
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Maven | org.springframework.kafka:spring-kafka | >= 2.8.1, < 2.9.11 | 2.9.11 | GHSA-crqf-q9fp-hwjw |
| Maven | org.springframework.kafka:spring-kafka | >= 3.0.0, < 3.0.10 | 3.0.10 | GHSA-crqf-q9fp-hwjw |
Advisories 1
- WID-SEC-2023-2170 VMware Tanzu Spring Framework for Apache Kafka: Schwachstelle ermöglicht nicht spezifizierten Angriff BSI CERT-Bund (WID) · Dec 18, 2023