VYPR
High severityNVD Advisory· Published Aug 23, 2021· Updated Aug 4, 2024

XStream is vulnerable to an Arbitrary Code Execution attack

CVE-2021-39154

Description

XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote 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. XStream 1.4.18 uses no longer a blacklist by default, since it cannot be secured for general purpose.

AI Insight

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

XStream versions through 1.4.17 allow remote code execution by manipulating XML input to load arbitrary classes from a remote host.

Vulnerability

In the affected XStream versions (all up to and including 1.4.17), the library unmarshals XML that contains type information to reconstruct serialized objects. An attacker can inject malicious type references into the input stream, causing XStream to load and instantiate classes from a remote server, leading to arbitrary code execution. The vulnerability does not affect users who have configured XStream's security framework with a whitelist of minimal required types [2].

Exploitation

The attacker needs only to provide a crafted XML input to a system that uses a vulnerable XStream configuration (i.e., no whitelist security framework). The exploit involves replacing the marshalled XML with a payload containing references to classes such as javax.naming.ldap.Rdn_-RdnEntry, javax.swing.MultiUIDefaults, and javax.swing.UIDefaults_-ProxyLazyValue that ultimately invoke javax.naming.InitialContext to load remote code. No authentication or prior access is necessary [2].

Impact

Successful exploitation allows a remote attacker to execute arbitrary code on the affected system, achieving full remote code execution (RCE). The attacker can run malicious code with the privileges of the XStream process, potentially leading to complete compromise of the application and server [1][2].

Mitigation

XStream 1.4.18 no longer uses a blacklist by default and users are strongly advised to upgrade to this version or later. For those unable to upgrade, the only known workaround is to properly configure the XStream security framework with a whitelist of permitted types. Distributions such as Fedora may provide updated packages [1][2][3][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.181.4.18

Affected products

6

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

17

News mentions

0

No linked articles in our index yet.