CVE-2023-34040
Java Deserialization vulnerability in Spring-Kafka When Improperly Configured
Reported by vmware · Published August 24, 2023
spring-kafka is fixed in 3.0.10 and 2.9.11 (Maven Central)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| org.springframework.kafka:spring-kafka | Maven Central | 3.0.10, 2.9.11 |
| Spring For Apache Kafka | Spring | 3.0.10, 2.9.11 |
| spring_for_apache_kafka | vmware | 3.0.9, 2.9.10 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Spring | Spring For Apache Kafka | 2.8.x, 2.9.x, 3.0.x |
| Maven | org.springframework.kafka:spring-kafka | 2.8.1, 3.0.0 |
| Spring | Spring For Apache Kafka | 2.8.x, 2.9.x, 3.0.x |
Timeline
- Aug 24, 2023 CVE Published
- Aug 24, 2023 PoC Published (11 in total, the first dated here)
- Aug 25, 2023 EPSS Score (30 in total, the first dated here)
- Dec 18, 2023 CVE Updated
- Mar 30, 2026 Security Advisory
- Aug 9, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-34040
vulnetix vdb fixes CVE-2023-34040
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-34040/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- Spring-Kafka-POC-CVE-2023-34040 exploit
- CVE-2023-34040 exploit
- CVE-2023-34040 exploit
- cve-2023-34040 exploit
- https://nvd.nist.gov/vuln/detail/CVE-2023-34040 advisory
- https://github.com/advisories/GHSA-crqf-q9fp-hwjw advisory
- https://github.com/spring-projects/spring-kafka/commit/25ac793a78725e2ca4a3a2888a1506a4bfcf0c9d patch
- https://github.com/spring-projects/spring-kafka/commit/eb779679812f61a8553ced3d0e4069dca65560ed patch
- https://github.com/spring-projects/spring-kafka url