XStream is vulnerable to an Arbitrary Code Execution attack
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, if using the version out of the box with Java runtime version 14 to 8 or with JavaFX installed. 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 up to 1.4.17 allow remote code execution via crafted XML when used with Java 8-14 or JavaFX.
Vulnerability
XStream versions 1.4.17 and earlier [1][2] deserialize XML input by recreating objects based on type information contained in the stream. When used out of the box with Java runtime version 14 to 8 or with JavaFX installed [1][2], the unmarshalling process does not restrict allowed types, enabling an attacker to inject objects that lead to arbitrary code execution. No user is affected who followed the recommendation to set up XStream's security framework with a whitelist limited to minimal required types [1][2].
Exploitation
An attacker only needs to manipulate the processed input stream fed to XStream's unmarshalling function [1][2]. No authentication or special network position beyond the ability to supply malicious XML data is required. The attack involves replacing the content of a serialized object, such as a java.util.PriorityQueue, with crafted XML that references gadget classes like com.sun.java.util.jar.pack.PackageWriter$2 and com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl to trigger code loading from a remote server [2].
Impact
Successful exploitation allows a remote attacker to load and execute arbitrary code from a remote host [1][2]. This results in full compromise of the confidentiality, integrity, and availability of the affected application, as the attacker gains code execution within the context of the XStream library user process.
Mitigation
XStream version 1.4.18 removes the default blacklist and requires users to explicitly configure a whitelist of permitted types [1][2]. Users should upgrade to 1.4.18 or later and follow the security framework recommendation [1][2]. No fix is available for those who cannot upgrade; they must restrict allowed types manually. The vulnerability is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog as of the publication date.
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.
| Package | Affected versions | Patched versions |
|---|---|---|
com.thoughtworks.xstream:xstreamMaven | < 1.4.18 | 1.4.18 |
Affected products
6- ghsa-coords5 versionspkg:maven/com.thoughtworks.xstream/xstreampkg:rpm/suse/xstream&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP2pkg:rpm/suse/xstream&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/xstream&distro=SUSE%20Manager%20Server%20Module%204.1pkg:rpm/suse/xstream&distro=SUSE%20Manager%20Server%20Module%204.2
< 1.4.18+ 4 more
- (no CPE)range: < 1.4.18
- (no CPE)range: < 1.4.18-3.14.1
- (no CPE)range: < 1.4.18-3.14.1
- (no CPE)range: < 1.4.18-3.14.1
- (no CPE)range: < 1.4.18-3.14.1
- x-stream/xstreamv5Range: < 1.4.18
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
17- github.com/advisories/GHSA-2q8x-2p7f-574vghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB/mitrevendor-advisoryx_refsource_FEDORA
- nvd.nist.gov/vuln/detail/CVE-2021-39153ghsaADVISORY
- www.debian.org/security/2021/dsa-5004ghsavendor-advisoryx_refsource_DEBIANWEB
- github.com/x-stream/xstream/security/advisories/GHSA-2q8x-2p7f-574vghsax_refsource_CONFIRMWEB
- lists.debian.org/debian-lts-announce/2021/09/msg00017.htmlghsamailing-listx_refsource_MLISTWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHPghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7ghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREBghsaWEB
- security.netapp.com/advisory/ntap-20210923-0003ghsaWEB
- security.netapp.com/advisory/ntap-20210923-0003/mitrex_refsource_CONFIRM
- www.oracle.com/security-alerts/cpuapr2022.htmlghsax_refsource_MISCWEB
- www.oracle.com/security-alerts/cpujan2022.htmlghsax_refsource_MISCWEB
- www.oracle.com/security-alerts/cpujul2022.htmlghsax_refsource_MISCWEB
- x-stream.github.io/CVE-2021-39153.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.