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

A Server-Side Forgery Request vulnerability in XStream via HashMap unmarshaling

CVE-2021-39152

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 request data from internal resources that are not publicly available only by manipulating the processed input stream with a Java runtime version 14 to 8. 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.18.

AI Insight

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

XStream deserialization vulnerability allows SSRF to internal resources via manipulated input stream on Java 8-14.

Vulnerability

XStream versions up to and including 1.4.17, when used with Java runtime versions 8 to 14 and relying on the default blacklist security framework, are vulnerable to a server-side request forgery (SSRF) [1]. The vulnerability exists because XStream reconstructs objects based on type information contained in the XML input during unmarshalling. An attacker can inject manipulated type information, such as jdk.nashorn.internal.runtime.Source_-URLData, causing XStream to create objects that initiate HTTP requests to arbitrary URLs [2].

Exploitation

An attacker with the ability to provide a crafted XML payload to an XStream endpoint can exploit this vulnerability. No authentication is required if the XStream instance is exposed. The attacker marshalls a simple HashMap to XML, then replaces the XML content with a specially crafted snippet that includes a URL pointing to an internal resource (e.g., http://localhost:8080/internal/). Unmarshalling this XML causes XStream to make a request to that URL, effectively performing an SSRF [2].

Impact

A successful exploit allows the attacker to make arbitrary HTTP requests from the server hosting XStream to internal resources (intranet or localhost) that are not publicly accessible. This can lead to disclosure of sensitive data or interaction with internal services. The vulnerability does not directly enable remote code execution but can be a stepping stone for further attacks [1][2].

Mitigation

Users who have set up XStream's security framework with a whitelist limited to minimal required types are not affected. For those relying on the default blacklist, upgrading to XStream version 1.4.18 or later is necessary [1]. The fixed version was released around the time of the CVE publication (2021-08-23) [2]. No workaround is available for versions that cannot be upgraded.

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

7

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.