Remote Code Execution Vulnerability in libxstream-java: CVE-2021-39146
Summary
CVE-2021-39146: 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 ↓
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.
No signup required · Results in about 60 seconds
Background
XStream is a powerful library designed for serializing Java objects to XML and deserializing XML back into Java objects. It is widely used in various applications due to its simplicity and flexibility. However, the library has a known vulnerability that can be exploited if not properly configured, allowing attackers to execute arbitrary code remotely.
Vulnerability Detail
CVE-2021-39146 is a critical vulnerability in XStream that allows remote attackers to load and execute arbitrary code from a remote host by manipulating the processed input stream. This vulnerability arises from the library's handling of input streams without adequate security measures. If users do not implement XStream's security framework with a whitelist of required types, they become susceptible to this risk. The vulnerability has a CVSS score of 8.5, indicating a high severity level.
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
As a temporary workaround, users can implement XStream's security framework by setting up a whitelist of allowed classes to prevent the loading of arbitrary code. This can be done by configuring the security settings in the application to restrict the types that can be deserialized.
Conclusion
CVE-2021-39146 represents a significant security risk for applications using the XStream library. Users are strongly advised to upgrade to the latest versions of libxstream-java to mitigate this vulnerability. Additionally, implementing security best practices, such as whitelisting allowed classes, can further enhance security.
See every vulnerability recorded for libxstream-java →
FAQ
CVE-2021-39146 is a vulnerability in the XStream library that allows remote code execution through manipulated input streams.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If exploited, this vulnerability can allow attackers to execute arbitrary code on the server, potentially leading to data breaches or system compromise.
Yes, implementing XStream's security framework with a strict whitelist of allowed classes can mitigate the risk temporarily.
The CVSS score of CVE-2021-39146 is 8.5, indicating a high severity level.
Related vulnerabilities
Recent vulnerabilities recorded for libxstream-java.