VYPR
High severityNVD Advisory· Published Mar 22, 2021· Updated Aug 3, 2024

XStream can cause a Denial of Service

CVE-2021-21341

Description

XStream is a Java library to serialize objects to XML and back again. In XStream before version 1.4.16, there is vulnerability which 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. No user is affected who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types. If you rely on XStream's default blacklist of the Security Framework, you will have to use at least version 1.4.16.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

XStream before 1.4.16 allows remote attackers to cause a denial of service (100% CPU usage) via a crafted XML input that triggers an endless loop during unmarshalling.

Vulnerability

Overview

CVE-2021-21341 is a denial-of-service vulnerability in XStream, a Java library for serializing objects to XML and back. The flaw exists in versions prior to 1.4.16 and stems from the way XStream handles type information during unmarshalling. By injecting a manipulated ByteArrayInputStream (or a derived class) into the input stream, an attacker can cause an endless loop that consumes 100% CPU time, effectively crashing the application [2][4].

Exploitation

The attack is remotely exploitable without authentication. An attacker simply sends a specially crafted XML payload to an application that uses XStream to deserialize user-supplied data. The payload includes a PriorityQueue with a manipulated ByteArrayInputStream that has a negative position value, leading to an infinite loop when processed [4]. No special network position or privileges are required.

Impact

Successful exploitation results in a complete denial of service, as the target system's CPU is fully occupied by the endless loop. The impact depends on CPU type and parallel execution, but in all cases the application becomes unresponsive. This can be used to disrupt services or as part of a larger attack chain [3].

Mitigation

Users are advised to upgrade to XStream version 1.4.16 or later, which fixes the vulnerability. Alternatively, administrators can configure XStream's security framework with a whitelist of allowed types, which prevents the injection of malicious classes. Users relying on the default blacklist are particularly vulnerable and must update immediately [2][4].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.thoughtworks.xstream:xstreamMaven
< 1.4.161.4.16

Affected products

10

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

23

News mentions

0

No linked articles in our index yet.