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

XStream is vulnerable to a Remote Command Execution attack

CVE-2021-21345

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 who has sufficient rights to execute commands of the host 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 command execution via manipulated input stream when security framework is not whitelisted.

Vulnerability

XStream is a Java library for serializing objects to XML. In versions prior to 1.4.16, the unmarshalling process uses type information from the input stream to recreate objects. An attacker can inject malicious type information, leading to the creation of objects that execute arbitrary commands on the host. [1][4]

Exploitation

The attack requires only the ability to supply a specially crafted XML (or JSON) input stream to XStream. The attacker does not need authentication if the application processes untrusted data. The manipulated stream can include objects like PriorityQueue with custom comparator chains that trigger command execution. [4]

Impact

Successful exploitation allows a remote attacker to execute arbitrary shell commands in the context of the server running XStream. This can lead to full system compromise, data exfiltration, or further lateral movement within the network. [3]

Mitigation

Users who have configured XStream's security framework with a whitelist of minimal required types are not affected. Those relying on the default blacklist must upgrade to XStream 1.4.16 or later. [2][1]

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

24

News mentions

0

No linked articles in our index yet.