Unsafe deserialization in Spring for Apache Kafka header mappers
CVE-2026-41731 is an unsafe deserialization vulnerability in Spring for Apache Kafka affecting JsonKafkaHeaderMapper and the deprecated DefaultKafkaHeaderMapper. The vulnerable logic matched header-declared types against trusted packages using a prefix check, so configuring trust for a package also implicitly trusted all of its subpackages. When this behavior is combined with Jackson's default bean deserialization, a malicious Kafka producer can send crafted header values that cause a consuming application to deserialize arbitrary JDK types. Spring notes that this can include classes whose constructors have side effects, such as allocating file descriptors or spawning thread pools. Affected versions are 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, and 2.8.0 through 2.8.11.
Are you exposed to this one?
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
Impact, mitigation & remediation
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
No public exploits tracked yet. Mallory keeps watching.
No public exploit code observed for this vulnerability.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
Recent activity
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
An input validation defect in messaging components affecting header configuration handling, enabling arbitrary class execution through crafted headers.
A deserialization-related vulnerability in Spring for Apache Kafka where trusted package checks used a prefix match in JsonKafkaHeaderMapper and DefaultKafkaHeaderMapper, allowing crafted header values to trigger deserialization of arbitrary JDK types.
A high-severity deserialization vulnerability in Spring for Apache Kafka caused by overly broad trusted-package matching in JsonKafkaHeaderMapper and DefaultKafkaHeaderMapper, allowing crafted headers to trigger deserialization of arbitrary JDK types with potentially dangerous side effects.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.