CVE-2021-43859
Java vulnerability analysis and mitigation

Overview

XStream, an open source Java library used to serialize objects to XML and back again, was found to be vulnerable to a Denial of Service attack (CVE-2021-43859). The vulnerability affects all versions up to and including 1.4.18. The issue was discovered by r00t4dm at Cloud-Penetrating Arrow Lab and was patched in version 1.4.19 (XStream Doc).

Technical details

The vulnerability occurs during the unmarshalling process when XStream recreates objects based on type information in the processed stream. An attacker can manipulate the input stream to inject objects that cause exponential recursive hashcode calculations. The issue affects several Java collection types including HashMap, HashSet, Hashtable, LinkedHashMap, LinkedHashSet, and in older Java versions, Stack and Vector. The vulnerability is present in formats that support references, such as XML, but does not affect JSON (XStream Doc, Jenkins Advisory).

Impact

A successful exploit allows remote attackers to cause a Denial of Service by consuming 100% CPU resources on the target system. The attack can be executed by manipulating the processed input stream, with the calculation time increasing exponentially due to the highly recursive structure (XStream Doc).

Mitigation and workarounds

Several workarounds are available: 1) Set NO_REFERENCE mode if the object graph doesn't use referenced elements, 2) Use the security framework to deny usage of affected collection types, 3) Change the default implementation of java.util.Map and java.util.Set to TreeMap and TreeSet respectively at unmarshalling time. The permanent fix is to upgrade to XStream version 1.4.19, which monitors and accumulates the time taken to add elements to collections and throws an exception if a set threshold is exceeded (XStream Doc, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-55749HIGH8.7
  • JavaJava
  • org.xwiki.platform:xwiki-platform-tool-jetty-resources
NoYesDec 01, 2025
CVE-2025-13806MEDIUM6.9
  • JavaJava
  • org.nutz:nutzboot-parent
NoNoDec 01, 2025
CVE-2025-13805MEDIUM6.3
  • JavaJava
  • org.nutz:nutzboot-parent
NoNoDec 01, 2025
CVE-2025-13804MEDIUM5.3
  • JavaJava
  • org.nutz:nutzboot-parent
NoNoDec 01, 2025
CVE-2025-66372LOW2.8
  • JavaJava
  • org.mustangproject:library
NoYesNov 28, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management