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

XStream is vulnerable to an Arbitrary Code Execution attack

CVE-2021-39146

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 up to 1.4.17 allows remote code execution via manipulated input stream by injecting arbitrary objects from a remote host.

Vulnerability

CVE-2021-39146 affects XStream versions up to and including 1.4.17 when used without a security framework whitelist. The vulnerability is an arbitrary code execution flaw that exists because the unmarshalling process reads type information from the input stream to recreate objects. An attacker can manipulate this processed XML input to inject objects that load and execute arbitrary code from a remote server. Users who configured XStream's security framework with a whitelist limited to minimal required types are not affected [1][2].

Exploitation

An attacker needs no special network position or authentication; the vulnerability is triggered when a victim unmarshals a crafted XML input using XStream. The attacker replaces a legitimate XML representation with a malicious snippet (for example, a sorted-set containing a javax.swing.MultiUIDefaults chain). When XStream deserializes the XML, the provided type information causes the framework to instantiate objects that lead to the loading and execution of attacker-controlled code from a remote host. No user interaction beyond processing the tampered input is required [2].

Impact

Successful exploitation gives the attacker the ability to execute arbitrary code in the context of the application using XStream. This can lead to full compromise of the affected system, including data disclosure, modification, or denial of service, depending on the privileges of the application. The impact is rated as critical with a CVSS score of 9.8 [1].

Mitigation

XStream 1.4.18 is the fixed version, which no longer uses a blacklist by default, as a blacklist approach cannot be secured for general purpose. Users should upgrade to version 1.4.18 or later immediately. For those unable to upgrade, following the recommendation to set up XStream's security framework with a strict whitelist of allowed types is a workaround [1][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.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.