CVE-2021-39144

8.5 HIGH

📋 TL;DR

CVE-2021-39144 is a remote code execution vulnerability in XStream library versions before 1.4.18. Attackers with sufficient privileges can execute arbitrary commands on the host by manipulating XML input streams. Only users who haven't implemented XStream's security framework with a minimal type whitelist are affected.

💻 Affected Systems

Products:
  • XStream
  • VMware NSX Manager
  • Other applications using XStream library
Versions: XStream versions before 1.4.18
Operating Systems: All operating systems running Java applications
Default Config Vulnerable: ⚠️ Yes
Notes: Default configurations are vulnerable. Only applications that implemented XStream's security framework with minimal type whitelist are protected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining complete control over the vulnerable server, allowing data theft, lateral movement, and persistent backdoor installation.

🟠

Likely Case

Remote code execution leading to application compromise, data exfiltration, and potential pivot to other internal systems.

🟢

If Mitigated

No impact if proper security framework with minimal whitelist is configured as recommended.

🌐 Internet-Facing: HIGH - Internet-facing applications using vulnerable XStream versions are directly exposed to remote exploitation.
🏢 Internal Only: MEDIUM - Internal applications are still vulnerable but require attacker to have internal network access.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Public exploit code exists and has been used in real attacks. Exploitation requires the attacker to be able to send malicious XML input to the vulnerable application.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: XStream 1.4.18

Vendor Advisory: https://github.com/x-stream/xstream/security/advisories/GHSA-j9h8-phrw-h4fh

Restart Required: Yes

Instructions:

1. Update XStream dependency to version 1.4.18 or later. 2. For Maven projects: update pom.xml to <version>1.4.18</version>. 3. For Gradle projects: update build.gradle to implementation 'com.thoughtworks.xstream:xstream:1.4.18'. 4. Rebuild and redeploy application. 5. Restart application server.

🔧 Temporary Workarounds

Implement XStream Security Framework

all

Configure XStream with a minimal type whitelist to prevent deserialization of dangerous classes

XStream xstream = new XStream();
xstream.allowTypes(new Class[]{MyClass1.class, MyClass2.class});

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all XML input
  • Deploy network segmentation and restrict access to vulnerable applications

🔍 How to Verify

Check if Vulnerable:

Check application dependencies for XStream version <1.4.18. For Java applications: check pom.xml, build.gradle, or lib directory for xstream JAR files.

Check Version:

For Maven: mvn dependency:tree | grep xstream. For deployed JAR: java -cp xstream-*.jar com.thoughtworks.xstream.XStream --version

Verify Fix Applied:

Verify XStream version is 1.4.18 or higher in dependencies. Test application with known malicious XML payloads to ensure they're rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual XML parsing errors
  • Java class loading exceptions for unexpected classes
  • Process execution from application context

Network Indicators:

  • Malformed XML payloads in HTTP requests
  • Unusual outbound connections from application server

SIEM Query:

source="application.logs" AND ("XStream" OR "deserialization") AND ("error" OR "exception" OR "ClassNotFoundException")

🔗 References

📤 Share & Export