# CVE-2026-59401: In Spring for Apache Kafka, trusted-package allowlist bypass via java.lang.Class header type allows arbitrary class initialization

- **Severity:** LOW 3.1
- **CVSS:** 3.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **Published:** 2026-12-02T07:11:27.902Z
- **Modified:** 2026-12-02T19:26:40.093Z

## Who should check

- Anyone running Spring for Apache Kafka \>= 4.1.0, \< 4.1.2.1; \>= 4.0.0, \< 4.0.8.1; \>= 3.0.0, \< 3.3.18; \>= 2.9.0, \< 2.9.16; \< 2.8.14; \>= 4.1.0, \< 4.1.3; \>= 4.0.0, \< 4.0.9

## Description

JsonKafkaHeaderMapper and the deprecated DefaultKafkaHeaderMapper check the header type requested in the spring\_json\_header\_types header against the mapper's trusted packages before deserializing a header value. Because java.lang is trusted by default, the type java.lang.Class passes this check. Deserializing a java.lang.Class header resolves the header value as a class name and loads that class, but the class named in the value is not subject to the trusted packages check.

 A malicious producer can use this to make the consumer load, and with some Jackson versions initialize, any class on the consumer's classpath, regardless of the trusted packages configuration. The impact depends on the side effects of the static initializers of the classes present on the classpath, such as resource allocation, driver registration, or blocking.

 An application is affected if it consumes records from a topic that an attacker can produce to and maps inbound headers with JsonKafkaHeaderMapper or DefaultKafkaHeaderMapper , which is the default when Jackson is on the classpath.

## Affected and fixed versions

- Spring for Apache Kafka: \>= 4.1.0, \< 4.1.2.1; \>= 4.0.0, \< 4.0.8.1; \>= 3.0.0, \< 3.3.18; \>= 2.9.0, \< 2.9.16; \< 2.8.14; \>= 4.1.0, \< 4.1.3; \>= 4.0.0, \< 4.0.9 (cvelist)

## Mitigation

- Upgrade Spring for Apache Kafka to 4.0.9 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-59401. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-59401.md
Affected: Spring for Apache Kafka >= 4.1.0, < 4.1.2.1; >= 4.0.0, < 4.0.8.1; >= 3.0.0, < 3.3.18; >= 2.9.0, < 2.9.16; < 2.8.14; >= 4.1.0, < 4.1.3; >= 4.0.0, < 4.0.9
Fixed in: Spring for Apache Kafka 4.1.2.1, Spring for Apache Kafka 4.0.8.1, Spring for Apache Kafka 3.3.18, Spring for Apache Kafka 2.9.16, Spring for Apache Kafka 2.8.14, Spring for Apache Kafka 4.1.3, Spring for Apache Kafka 4.0.9

Steps:
1. Search this machine and project for Spring for Apache Kafka: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-59401 being exploited?

There is no confirmed exploitation: CVE-2026-59401 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-59401?

Low: CVSS 3.1 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-59401?

Spring for Apache Kafka \>= 4.1.0, \< 4.1.2.1; \>= 4.0.0, \< 4.0.8.1; \>= 3.0.0, \< 3.3.18; \>= 2.9.0, \< 2.9.16; \< 2.8.14; \>= 4.1.0, \< 4.1.3; \>= 4.0.0, \< 4.0.9.

### Is there a fix for CVE-2026-59401?

Yes. Fixed in Spring for Apache Kafka 4.1.2.1, Spring for Apache Kafka 4.0.8.1, Spring for Apache Kafka 3.3.18, Spring for Apache Kafka 2.9.16, Spring for Apache Kafka 2.8.14, Spring for Apache Kafka 4.1.3, Spring for Apache Kafka 4.0.9. Upgrade Spring for Apache Kafka to 4.0.9 or later.

### How do I check if I'm affected by CVE-2026-59401?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://spring.io/security/cve-2026-59401>
- other: <https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L&version=3.1>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-59401>

HTML: <https://flawdb.com/CVE-2026-59401> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-59401>
