CVE-2021-39145
Arbitrary Code Execution vulnerability in com.thoughtworks.xstream:xstream

Arbitrary Code Execution No known exploit

What is CVE-2021-39145 About?

This vulnerability allows a remote attacker to load and execute arbitrary code by manipulating the processed input stream of XStream. While severe, users who have configured XStream's security framework with a strict whitelist are not affected. Exploitation involves carefully crafted input to trigger the code execution.

Affected Software

com.thoughtworks.xstream:xstream <1.4.18

Technical Details

The vulnerability in XStream 1.4.x arises from insecure deserialization when processing input streams. A remote attacker can craft a malicious input stream (e.g., XML) that, when deserialized by a vulnerable XStream instance, triggers the loading and execution of arbitrary code from a remote host. This is typically achieved by embedding references to malicious classes or gadgets within the serialized data that, upon instantiation, execute system commands or load external code. The attack vector specifically targets XStream's default behavior, which prior to 1.4.18, relied on a blacklist approach that could be bypassed.

What is the Impact of CVE-2021-39145?

Successful exploitation may allow attackers to execute arbitrary code, leading to full system compromise, data exfiltration, or denial of service.

What is the Exploitability of CVE-2021-39145?

Exploitation requires the ability to supply a malicious input stream to an application using a vulnerable version of XStream. The complexity is moderate, involving the creation of a specifically crafted serialized object. No authentication is typically required if the vulnerable XStream endpoint is publicly accessible and processes unauthenticated input. The attack is remote, as it relies on sending data over a network. The likelihood of exploitation increases if the application processes untrusted XML or JSON inputs without proper deserialization controls, especially if a whitelist for allowed types is not implemented.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for CVE-2021-39145?

Available Upgrade Options

  • com.thoughtworks.xstream:xstream
    • <1.4.18 → Upgrade to 1.4.18

Struggling with dependency upgrades?

See how Resolved Security's drop-in replacements make it simple.

Book a demo

Additional Resources

What are Similar Vulnerabilities to CVE-2021-39145?

Similar Vulnerabilities: CVE-2021-21341 , CVE-2020-26217 , CVE-2017-7957 , CVE-2017-1000487 , CVE-2016-3674