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

> Attackers can achieve remote code execution by exploiting overly broad trusted-package matching in Spring for Apache Kafka header mappers.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jun 2026
- **Updated:** 5 Aug 2026
- **Also known as:** GHSA-xq69-5h5v-x9x4, MINI-5q4c-qr79-rrqg, MINI-m6jw-pfrj-p7vx, ROOT-APP-MAVEN-CVE-2026-41731

## What is CVE-2026-41731?

CVE-2026-41731 is a high-severity unsafe deserialization vulnerability in Spring for Apache Kafka, published on 9 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-502 (Deserialization of Untrusted Data)

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

10 open source packages ship an affected version, including org.springframework.kafka:spring-kafka. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.kafka:spring-kafka` | Maven | All versions to 2.8.11 | None |
| `org.springframework.kafka:spring-kafka` | Maven | All versions to 2.8.11 | None |
| `org.springframework.kafka:spring-kafka` | Maven | From 2.9.0 to 2.9.13 | None |
| `org.springframework.kafka:spring-kafka` | Maven | From 2.9.0 to 2.9.13 | None |
| `org.springframework.kafka:spring-kafka` | Maven | From 3.2.0 to 3.2.13 | None |
| `org.springframework.kafka:spring-kafka` | Maven | From 3.2.0 to 3.2.13 | None |
| `org.springframework.kafka:spring-kafka` | Maven | From 3.3.0 | 3.3.16 |
| `org.springframework.kafka:spring-kafka` | Maven | From 3.3.0 | 3.3.16 |
| `org.springframework.kafka:spring-kafka` | Maven | From 4.0.0 | 4.0.6 |
| `org.springframework.kafka:spring-kafka` | Maven | From 4.0.0 | 4.0.6 |

Products: Redhat Fuse, Redhat Jboss Enterprise Application Platform Expansion Pack, Vmware Spring for Apache Kafka.

## How do I fix CVE-2026-41731?

Upgrade org.springframework.kafka:spring-kafka to a fixed version for your release line: 3.3.16 or 4.0.6.

## Is CVE-2026-41731 being exploited?

There is no known exploitation of CVE-2026-41731 in the wild and no public exploit code.

## Other vulnerabilities in Spring for Apache Kafka

- [CVE-2021-3690](https://insights.sbomify.com/CVE-2021-3690/): Undertow vulnerable to memory exhaustion due to buffer leak (high 7.5)
- [CVE-2019-14860](https://insights.sbomify.com/CVE-2019-14860/): Misconfiguration in syndesis (high 7.4)
- [CVE-2025-57849](https://insights.sbomify.com/CVE-2025-57849/): Fuse: privilege escalation via excessive /etc/passwd permissions (medium 6.4)
- [CVE-2020-10688](https://insights.sbomify.com/CVE-2020-10688/): Cross-site scripting in RESTEasy (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41731 and fix it if it is affected.

What it is: CVE-2026-41731 is a high-severity unsafe deserialization vulnerability in Spring for Apache Kafka, published on 9 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-41731 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.kafka:spring-kafka (Maven): affected all versions up to 2.8.11; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected all versions up to 2.8.11; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected from 2.9.0 up to 2.9.13; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected from 2.9.0 up to 2.9.13; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected from 3.2.0 up to 3.2.13; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected from 3.2.0 up to 3.2.13; no fix listed
- org.springframework.kafka:spring-kafka (Maven): affected from 3.3.0; fixed in 3.3.16
- org.springframework.kafka:spring-kafka (Maven): affected from 3.3.0; fixed in 3.3.16
- org.springframework.kafka:spring-kafka (Maven): affected from 4.0.0; fixed in 4.0.6
- org.springframework.kafka:spring-kafka (Maven): affected from 4.0.0; fixed in 4.0.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-41731/ (Markdown: https://insights.sbomify.com/CVE-2026-41731/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-41731
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-41731
- OSV: https://osv.dev/vulnerability/CVE-2026-41731

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-41731/
Summaries are generated and may contain mistakes; the official description above is the record.
