Vulnerability record · CVE-2021-29505 · published 28 May 2021
CVE-2021-29505: XStream XML deserialization allows remote command execution
Xstream · Xstream
XStream versions prior to 1.4.17 deserialize untrusted XML input without adequate type restrictions, allowing an attacker with sufficient rights to execute commands on the host by manipulating the processed input stream. It matters because XStream is widely embedded in Java applications and downstream products, and the flaw is a code injection via deserialization of untrusted data. Deployments that configured XStream's security framework with a minimal whitelist are not affected.
Description
XStream is software for serializing Java objects to XML and back again. A vulnerability in XStream versions prior to 1.4.17 may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types is affected. The vulnerability is patched in version 1.4.17.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Automated analysis
high priorityRemote code execution with a CVSS of 8.8 and a very high EPSS probability, though exploitation requires some existing privileges and no KEV listing exists.
What it is
XStream versions prior to 1.4.17 deserialize untrusted XML input without adequate type restrictions, allowing an attacker with sufficient rights to execute commands on the host by manipulating the processed input stream. It matters because XStream is widely embedded in Java applications and downstream products, and the flaw is a code injection via deserialization of untrusted data. Deployments that configured XStream's security framework with a minimal whitelist are not affected.
Impact
An attacker who can supply crafted XML to a vulnerable XStream instance gains remote command execution on the host with the privileges of the application. This can lead to full compromise of confidentiality, integrity and availability of that system.
Attack surface
Reached over the network by submitting a manipulated serialized XML stream to an application that uses XStream for deserialization. The CVSS vector indicates low privileges are required (PR:L) and no user interaction (UI:N), so the attacker needs some existing access or rights on the target application.
Exploitation
Not listed in CISA KEV and no ransomware associations are documented, but EPSS is very high at 0.772 (99.5th percentile), indicating strong likelihood of exploitation activity. References include patch commits and vendor advisories, with no public exploit tag in the record.
What to do
- Upgrade XStream to version 1.4.17 or later, which patches the flaw.
- Apply vendor patches for downstream products (Debian, Fedora, NetApp, Oracle) that bundle XStream.
- Configure XStream's security framework with a whitelist limited to the minimal required types, which the advisory states prevents exploitation.
- Avoid deserializing XML from untrusted or unauthenticated sources; validate and restrict input where deserialization is unavoidable.
- Restrict application privileges so a compromised process cannot execute arbitrary host commands.
Detection
- Monitor application and host logs for unexpected process execution or command spawning from Java application servers using XStream.
- Inspect inbound XML payloads for XStream-specific class and field markers that indicate deserialization gadget attempts.
- Track XStream library versions across applications and flag any instance below 1.4.17.
- Alert on outbound network connections or file writes originating from the deserialization code path.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
17 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2021-29505 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-29505), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.