# CVE-2023-34040: Java Deserialization vulnerability in Spring-Kafka When Improperly Configured

- Priority: **Routine**
- Reason: Not severe (CVSS 5.3, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-08-24 · Modified: 2024-10-01
- Aliases: GHSA-crqf-q9fp-hwjw
- Record: https://cvemate.com/vulnerability/CVE-2023-34040 · JSON: https://cvemate.com/vulnerability/CVE-2023-34040/json

## Description

```text
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.
```

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.09%, percentile 82.247%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- org.springframework.kafka spring-kafka (Maven): ≥ 2.8.1, \< 2.9.11 \| ≥ 3.0.0, \< 3.0.10
- spring spring for apache kafka: ≥ 2.8.x, \< 2.9.11 \| ≥ 2.9.x, \< 2.9.11 \| ≥ 3.0.x, \< 3.0.10
- vmware spring\_for\_apache\_kafka: ≥ 2.8.1, ≤ 2.9.10 \| ≥ 3.0.0, ≤ 3.0.9

## References

- <https://spring.io/security/cve-2023-34040>
- <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>

---

Data as of 2026-12-05T04:20:35.150Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
