Remote Command Execution Vulnerability in libxstream-java: CVE-2021-39144

libxstream-java Updated 02 Oct 2025

Summary

23/08/2021
N/A
Yes i
High
8.5

CVE-2021-39144: XStream is a simple library to serialize objects to XML and back again. Affects libxstream-java across 2 version ranges.

< 1.4.15-3+deb11u1 < b9ad1c02724c2b1636a8794c8e1bcd630f46c0b3

Fixed in 1.4.15-3+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

XStream is a popular open-source library used for serializing Java objects to XML and deserializing XML back to Java objects. It is widely utilized in various applications for its simplicity and efficiency in handling XML data. However, certain versions of XStream are vulnerable to a remote command execution issue, which can be exploited if the security framework is not properly configured.

Vulnerability Detail

CVE-2021-39144 is a vulnerability in XStream that allows a remote attacker with sufficient rights to execute arbitrary commands on the host system by manipulating the input stream processed by the library. This vulnerability arises from the library's default configuration, which does not implement a secure whitelist for object types, making it susceptible to exploitation. If an application using XStream does not restrict the types of objects that can be deserialized, an attacker could potentially gain control over the application and execute harmful commands.

How To Fix

Minimum fixed version

1.4.15-3+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxstream-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, a temporary workaround is to implement a security framework in XStream that restricts the types of objects that can be deserialized. This can be done by setting up a whitelist of allowed classes. Here is an example of how to configure the whitelist:

XStream xstream = new XStream();

// Allow only specific classes
xstream.allowTypeHierarchy(MyAllowedClass.class);

// Add more allowed classes as needed
xstream.allowTypeHierarchy(AnotherAllowedClass.class);

Conclusion

CVE-2021-39144 presents a significant risk to applications using the XStream library if not properly mitigated. Upgrading to a secure version and implementing a whitelist for deserialization are critical steps to protect against potential exploitation. Utilizing tools like Vulert can help monitor vulnerabilities in real-time.

See every vulnerability recorded for libxstream-java →

Share this vulnerability

FAQ

CVE-2021-39144 is a vulnerability in the XStream library that allows remote command execution due to improper input stream handling.

Affected versions include those prior to 1.4.15-3+deb11u1 for Debian 11 and prior to 1.4.18-1 for Debian 12 and 13.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software by simply using a manifest file like package-lock.json.

The CVSS score for CVE-2021-39144 is 8.5, indicating a high severity level.

If you cannot upgrade, implement a security framework in XStream to restrict deserialization to a whitelist of allowed classes as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for libxstream-java.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.4.15-3+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxstream-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback