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

XStream is vulnerable to an attack using Regular Expression for a Denial of Service (ReDos)

CVE-2021-21348

Description

XStream is a Java library to serialize objects to XML and back again. In XStream before version 1.4.16, there is a vulnerability which may allow a remote attacker to occupy a thread that consumes maximum CPU time and will never return. 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 is vulnerable to a ReDoS attack allowing remote attackers to cause a denial of service via crafted XML input.

Vulnerability

Details

CVE-2021-21348 is a denial of service vulnerability in XStream versions prior to 1.4.16. The root cause is an improper handling of user-supplied regular expressions during the unmarshalling of serialized data. An attacker can provide a crafted XML input that triggers a malicious regular expression evaluation, causing a single thread to consume 100% CPU indefinitely [4].

Exploitation

The attack is remotely exploitable without authentication. An attacker sends a specially crafted XML (or other supported format) to an XStream instance that has not been secured with a whitelist-based security framework. The injected data leads to the execution of a regular expression that enters an endless loop or excessive computation, as described in the advisory [4]. Users who follow the recommendation to set up a whitelist of allowed types are not affected [2].

Impact

Successful exploitation results in a denial of service: the affected thread never returns, blocking processing and potentially causing application unavailability. The vulnerability does not lead to data theft or remote code execution, but can effectively halt server operations.

Mitigation

Users should upgrade to XStream version 1.4.16 or later, which includes a fix [1]. Alternatively, deploying the security framework with a whitelist of minimal required types prevents exploitation [2].

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

7

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.