Every CVE Search/ Get API key

CVE-2021-43859

Denial of Service by injecting highly recursive collections or maps in XStream

7.5 HighFix available

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

7.93%Up 5.7 points since Feb 2, 2022
90%50%10%1%

What each source reports

CVE List Score used 7.5

Denial of Service by injecting highly recursive collections or maps in XStream

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
CVE-2021-43859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
EUVDEUVD-2022-1176 7.5

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
EUVD-2022-1176
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-rmr5-cpv2-vgjf 7.5

Denial of Service by injecting highly recursive collections or maps in XStream

Impact

The vulnerability may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream.

Patches

XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded.

Workarounds

The attack uses the hash code implementation for collections and maps to force an exponential calculation time due to highly recursive structures with in the collection or map. Following types of the Java runtime are affected in Java versions available in December 2021:

  • java.util.HashMap
  • java.util.HashSet
  • java.util.Hashtable
  • java.util.LinkedHashMap
  • java.util.LinkedHashSet
  • java.util.Stack (older Java revisions only)
  • java.util.Vector (older Java revisions only)
  • Other third party collection implementations that use their element's hash code may also be affected

If your object graph does not use referenced elements at all, you may simply set the NO_REFERENCE mode:

XStream xstream = new XStream();
xstream.setMode(XStream.NO_REFERENCES);

If your object graph contains neither a Hashtable, HashMap nor a HashSet (or one of the linked variants of it) then you can use the security framework to deny the usage of these types:

XStream xstream = new XStream();
xstream.denyTypes(new Class[]{
 java.util.HashMap.class, java.util.HashSet.class, java.util.Hashtable.class, java.util.LinkedHashMap.class, java.util.LinkedHashSet.class
});

Unfortunately these types are very common. If you only use HashMap or HashSet and your XML refers these only as default map or set, you may additionally change the default implementation of java.util.Map and java.util.Set at unmarshalling time::

xstream.addDefaultImplementation(java.util.TreeMap.class, java.util.Map.class);
xstream.addDefaultImplementation(java.util.TreeSet.class, java.util.Set.class);

However, this implies that your application does not care about the implementation of the map and all elements are comparable.

References

See full information about the nature of the vulnerability and the steps to reproduce it in XStream's documentation for CVE-2021-43859.

Credits

The vulnerability was discovered and reported by r00t4dm at Cloud-Penetrating Arrow Lab.

For more information

If you have any questions or comments about this advisory:

Record
GHSA-rmr5-cpv2-vgjf
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-502
Updated
2026-11-02
NVD 7.5

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
CVE-2021-43859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-400
Updated
2026-11-02
OSV 7.5

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
CVE-2021-43859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-43859 7.5

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
DEBIAN-CVE-2021-43859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 11 moreShow less
OSVGHSA-rmr5-cpv2-vgjf 7.5

Denial of Service by injecting highly recursive collections or maps in XStream

Impact

The vulnerability may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream.

Patches

XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded.

Workarounds

The attack uses the hash code implementation for collections and maps to force an exponential calculation time due to highly recursive structures with in the collection or map. Following types of the Java runtime are affected in Java versions available in December 2021:

  • java.util.HashMap
  • java.util.HashSet
  • java.util.Hashtable
  • java.util.LinkedHashMap
  • java.util.LinkedHashSet
  • java.util.Stack (older Java revisions only)
  • java.util.Vector (older Java revisions only)
  • Other third party collection implementations that use their element's hash code may also be affected

If your object graph does not use referenced elements at all, you may simply set the NO_REFERENCE mode:

XStream xstream = new XStream();
xstream.setMode(XStream.NO_REFERENCES);

If your object graph contains neither a Hashtable, HashMap nor a HashSet (or one of the linked variants of it) then you can use the security framework to deny the usage of these types:

XStream xstream = new XStream();
xstream.denyTypes(new Class[]{
 java.util.HashMap.class, java.util.HashSet.class, java.util.Hashtable.class, java.util.LinkedHashMap.class, java.util.LinkedHashSet.class
});

Unfortunately these types are very common. If you only use HashMap or HashSet and your XML refers these only as default map or set, you may additionally change the default implementation of java.util.Map and java.util.Set at unmarshalling time::

xstream.addDefaultImplementation(java.util.TreeMap.class, java.util.Map.class);
xstream.addDefaultImplementation(java.util.TreeSet.class, java.util.Set.class);

However, this implies that your application does not care about the implementation of the map and all elements are comparable.

References

See full information about the nature of the vulnerability and the steps to reproduce it in XStream's documentation for CVE-2021-43859.

Credits

The vulnerability was discovered and reported by r00t4dm at Cloud-Penetrating Arrow Lab.

For more information

If you have any questions or comments about this advisory:

Record
GHSA-rmr5-cpv2-vgjf
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-502
Updated
2026-11-02
OSVOESA-2022-1512 7.5

xstream security update

Java XML serialization library.

Security Fix(es):

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.(CVE-2021-43859)

Record
OESA-2022-1512
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVOESA-2022-2066 7.5

xstream security update

XStream is a simple library to serialize objects to XML and back again. A high level facade is supplied that simplifies common use cases. Custom objects can be serialized without need for specifying mappings. Speed and low memory footprint are a crucial part of the design,making it suitable for large object graphs or systems with high message throughput. No information is duplicated that can be obtained via reflection. This results in XML that is easier to read for humans and more compact than native Java serialization. XStream serializes internal fields, including private and final. Supports non-public and inner classes. Classes are not required to have default constructor.Duplicate references encountered in the object-model will be maintained. Supports circular references. By implementing an interface, XStream can serialize directly to/from any tree structure (not just XML). Strategies can be registered allowing customization of how particular types are represented as XML. When an exception occurs due to malformed XML, detailed diagnostics are provided to help isolate and fix the problem.

Security Fix(es):

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.(CVE-2021-43859)

Record
OESA-2022-2066
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHLW-2026-c69885b4933c8262 7.5

Lightwell Security Advisory: xstream 1.4.18.rhlw-00006

Red Hat Lightwell has released com.thoughtworks.xstream:xstream 1.4.18.rhlw-00006 with backported fixes for CVE-2021-43859, CVE-2022-41966, and CVE-2024-47072.

CVE-2021-43859: XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

CVE-2022-41966: XStream Denial of Service via stack overflow

CVE-2024-47072: XStream is vulnerable to a Denial of Service attack due to stack overflow from a manipulated binary input stream

This patched artifact is a drop-in replacement for com.thoughtworks.xstream:xstream 1.4.18 from Maven Central.

Record
RHLW-2026-c69885b4933c8262
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2022:1420 8.8

Red Hat Security Advisory: OpenShift Container Platform 3.11.685 security and bug fix update

Record
RHSA-2022:1420
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-43859 7.5

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
UBUNTU-CVE-2021-43859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVBIT-jenkins-2021-43859 No score

Denial of Service by injecting highly recursive collections or maps in XStream

XStream is an open source java library to serialize objects to XML and back again. Versions prior to 1.4.19 may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting in a denial of service only by manipulating the processed input stream. XStream 1.4.19 monitors and accumulates the time it takes to add elements to collections and throws an exception if a set threshold is exceeded. Users are advised to upgrade as soon as possible. Users unable to upgrade may set the NO_REFERENCE mode to prevent recursion. See GHSA-rmr5-cpv2-vgjf for further details on a workaround if an upgrade is not possible.

Record
BIT-jenkins-2021-43859
Updated
2026-11-02
OSVCLSA-2026-1784250511 No score

TuxCare security update for com.thoughtworks.xstream:xstream (2 CVEs)

TuxCare rebuilt com.thoughtworks.xstream:xstream to address 2 CVEs. Fixed in 1.4.17-tuxcare.2.

Record
CLSA-2026-1784250511
Updated
2026-11-02
OSVopenSUSE-SU-2022:0817-1 No score

Security update for xstream

This update for xstream fixes the following issues:

  • CVE-2021-43859: Fixed a denial of service when unmarshalling highly recursive collections or maps (bsc#1195458).
Record
openSUSE-SU-2022:0817-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11809-1 No score

xstream-1.4.19-1.1 on GA media

These are all security issues fixed in the xstream-1.4.19-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11809-1
Updated
2026-11-02
OSVSUSE-SU-2022:0817-1 No score

Security update for xstream

This update for xstream fixes the following issues:

  • CVE-2021-43859: Fixed a denial of service when unmarshalling highly recursive collections or maps (bsc#1195458).
Record
SUSE-SU-2022:0817-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
com.thoughtworks.xstream:xstream
Maven
before 1.4.19
1.4.19
jenkins
Bitnami
before 2.319.3, 2.321.0 up to 2.334.0
2.319.32.334.0
com.thoughtworks.xstream:xstream
TuxCare:Maven
From an advisory covering 2 CVEs
1.4.17 up to 1.4.17-tuxcare.2, plus listed versions
1.4.17-tuxcare.1
1.4.17-tuxcare.2
libxstream-java
Debian:12
before 1.4.19-1
1.4.19-1
libxstream-java
Debian:13
before 1.4.19-1
1.4.19-1
libxstream-java
Debian:14
before 1.4.19-1
1.4.19-1
libxstream-java
Debian:9
before 1.4.11.1-1+deb9u5, plus listed versions
1.4.10-11.4.11-11.4.11.1-11.4.11.1-1+deb9u11.4.11.1-1+deb9u2
Show 4 moreShow less
1.4.11.1-1+deb9u31.4.11.1-1+deb9u41.4.9-21.4.9-2+deb9u1
1.4.11.1-1+deb9u5
libxstream-java
Debian:11
From an advisory covering 2 CVEs
before 1.4.15-3+deb11u3, plus listed versions
1.4.15-31.4.15-3+deb11u11.4.15-3+deb11u2
1.4.15-3+deb11u3
com.thoughtworks.xstream:xstream
Maven
before 1.4.19, plus listed versions
0.10.20.30.50.6
Show 38 moreShow less
1.01.0.11.0.21.11.1.11.1.21.1.31.21.2.11.2.21.31.3.11.41.4.11.4.101.4.10-java71.4.111.4.11-java71.4.11.11.4.121.4.12-java71.4.131.4.13-java71.4.141.4.14-java71.4.14-jdk71.4.151.4.161.4.171.4.181.4.21.4.31.4.41.4.51.4.61.4.71.4.81.4.9
1.4.19
xstream
openEuler:20.03-LTS-SP1
before 1.4.18-2.oe1
1.4.18-2.oe1
Show 21 moreShow less
Affected packages
PackageAffectedFixed
xstream
openEuler:20.03-LTS-SP2
before 1.4.18-2.oe1
1.4.18-2.oe1
xstream
openEuler:20.03-LTS-SP3
before 1.4.18-2.oe1
1.4.18-2.oe1
xstream
openEuler:22.03-LTS
before 1.4.18-2.oe2203
1.4.18-2.oe2203
com.thoughtworks.xstream:xstream
Red Hat Lightwell:Maven
From an advisory covering 3 CVEs
before 1.4.18.rhlw-00006, plus listed versions
0.10.20.30.50.6
Show 38 moreShow less
1.01.0.11.0.21.11.1.11.1.21.1.31.21.2.11.2.21.31.3.11.41.4.11.4.101.4.10-java71.4.111.4.11-java71.4.11.11.4.121.4.12-java71.4.131.4.13-java71.4.141.4.14-java71.4.14-jdk71.4.151.4.161.4.171.4.181.4.21.4.31.4.41.4.51.4.61.4.71.4.81.4.9
1.4.18.rhlw-00006
jenkins
Red Hat:openshift:3.11::el7
From an advisory covering 13 CVEs
before 0:2.319.3.1650348949-1.el7
0:2.319.3.1650348949-1.el7
jenkins-2-plugins
Red Hat:openshift:3.11::el7
From an advisory covering 13 CVEs
before 0:3.11.1650371376-1.el7
0:3.11.1650371376-1.el7
xstream
SUSE:Linux Enterprise Module for Development Tools 15 SP3
before 1.4.19-3.18.2
1.4.19-3.18.2
xstream
SUSE:Manager Server Module 4.1
before 1.4.19-3.18.2
1.4.19-3.18.2
xstream
SUSE:Manager Server Module 4.2
before 1.4.19-3.18.2
1.4.19-3.18.2
xstream
SUSE:Linux Enterprise Real Time 15 SP2
before 1.4.19-3.18.2
1.4.19-3.18.2
libxstream-java
Ubuntu:Pro:14.04:LTS
All versions, plus listed versions
1.4.4-11.4.7-11.4.7-1ubuntu0.11.4.7-1ubuntu0.1+esm11.4.7-1ubuntu0.1+esm2
None known
libxstream-java
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
1.4.8-11.4.8-1ubuntu0.11.4.8-1ubuntu0.1+esm11.4.8-1ubuntu0.1+esm21.4.8-1ubuntu0.1+esm3
None known
libxstream-java
Ubuntu:18.04:LTS
All versions, plus listed versions
1.4.10-11.4.11.1-1~18.041.4.11.1-1~18.04.11.4.11.1-1~18.04.21.4.11.1-1+deb10u4build0.18.04.1
None known
libxstream-java
Ubuntu:20.04:LTS
All versions, plus listed versions
1.4.11.1-11.4.11.1-1ubuntu0.11.4.11.1-1ubuntu0.21.4.11.1-1ubuntu0.3
None known
libxstream-java
Ubuntu:22.04:LTS
All versions, plus listed versions
1.4.15-41.4.18-21.4.18-2ubuntu0.1
None known
libxstream-java
Ubuntu:24.04:LTS
All versions, plus listed versions
1.4.20-1
None known
libxstream-java
Ubuntu:25.10
All versions, plus listed versions
1.4.21-1
None known
libxstream-java
Ubuntu:26.10
All versions, plus listed versions
1.4.21-1
None known
libxstream-java
Ubuntu:26.04:LTS
All versions, plus listed versions
1.4.21-1
None known
xstream
openSUSE:Leap 15.3
before 1.4.19-3.18.2
1.4.19-3.18.2
xstream
openSUSE:Tumbleweed
before 1.4.19-1.1
1.4.19-1.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-43859 is a high vulnerability (CVSS 7.5) in X-stream Xstream, published February 1, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 7.93%, the 94th percentile. Fixed in com.thoughtworks.xstream:xstream 1.4.19.

References

Show 81 moreShow less
MoveEnter Open