CVE-2021-39150
📋 TL;DR
CVE-2021-39150 is a deserialization vulnerability in XStream library that allows remote attackers to access internal resources by manipulating XML input streams. Only affects users who rely on XStream's default blacklist security configuration rather than implementing a proper whitelist. Requires Java runtime versions 8-14.
💻 Affected Systems
- XStream
📦 What is this software?
Communications Billing And Revenue Management Elastic Charging Engine by Oracle
View all CVEs affecting Communications Billing And Revenue Management Elastic Charging Engine →
Communications Billing And Revenue Management Elastic Charging Engine by Oracle
View all CVEs affecting Communications Billing And Revenue Management Elastic Charging Engine →
Communications Cloud Native Core Automated Test Suite by Oracle
View all CVEs affecting Communications Cloud Native Core Automated Test Suite →
Communications Cloud Native Core Binding Support Function by Oracle
View all CVEs affecting Communications Cloud Native Core Binding Support Function →
Communications Cloud Native Core Policy by Oracle
View all CVEs affecting Communications Cloud Native Core Policy →
Communications Unified Inventory Management by Oracle
View all CVEs affecting Communications Unified Inventory Management →
Communications Unified Inventory Management by Oracle
View all CVEs affecting Communications Unified Inventory Management →
Communications Unified Inventory Management by Oracle
View all CVEs affecting Communications Unified Inventory Management →
Communications Unified Inventory Management by Oracle
View all CVEs affecting Communications Unified Inventory Management →
Communications Unified Inventory Management by Oracle
View all CVEs affecting Communications Unified Inventory Management →
Fedora by Fedoraproject
Fedora by Fedoraproject
Fedora by Fedoraproject
Xstream by Xstream
⚠️ Risk & Real-World Impact
Worst Case
Remote attacker could access sensitive internal resources, potentially leading to data exfiltration or further internal network compromise.
Likely Case
Unauthorized access to internal resources that should not be publicly exposed, potentially exposing configuration files, internal APIs, or sensitive data.
If Mitigated
No impact for users who properly configured XStream's security framework with a minimal required types whitelist.
🎯 Exploit Status
Exploitation requires sending specially crafted XML to XStream endpoints. Public advisory includes technical details.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.4.18
Vendor Advisory: https://github.com/x-stream/xstream/security/advisories/GHSA-cxfm-5m4g-x7xp
Restart Required: Yes
Instructions:
1. Update XStream dependency to version 1.4.18 or later. 2. Update pom.xml or build.gradle to reference new version. 3. Rebuild and redeploy application. 4. Restart affected services.
🔧 Temporary Workarounds
Implement Security Framework Whitelist
allConfigure XStream's security framework with minimal required types whitelist instead of relying on default blacklist.
// Java code example: 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 to XStream endpoints
- Restrict network access to XStream endpoints using firewalls or network segmentation
🔍 How to Verify
Check if Vulnerable:
Check XStream version in application dependencies. If version < 1.4.18 and using default security configuration, system is vulnerable.
Check Version:
Check build configuration files (pom.xml, build.gradle) or run: java -cp "xstream-*.jar" com.thoughtworks.xstream.XStream --version
Verify Fix Applied:
Verify XStream version is 1.4.18 or later in application dependencies and verify security framework is properly configured.
📡 Detection & Monitoring
Log Indicators:
- Unusual XML parsing errors
- Unexpected class loading attempts in XStream logs
- Access to unexpected internal resources
Network Indicators:
- Unusual XML payloads to application endpoints
- Requests to internal resources from application servers
SIEM Query:
source="application.logs" AND ("XStream" OR "deserialization") AND ("error" OR "exception") AND ("ClassNotFoundException" OR "SecurityException")
🔗 References
- https://github.com/x-stream/xstream/security/advisories/GHSA-cxfm-5m4g-x7xp
- https://lists.debian.org/debian-lts-announce/2021/09/msg00017.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB/
- https://security.netapp.com/advisory/ntap-20210923-0003/
- https://www.debian.org/security/2021/dsa-5004
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://x-stream.github.io/CVE-2021-39150.html
- https://github.com/x-stream/xstream/security/advisories/GHSA-cxfm-5m4g-x7xp
- https://lists.debian.org/debian-lts-announce/2021/09/msg00017.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB/
- https://security.netapp.com/advisory/ntap-20210923-0003/
- https://www.debian.org/security/2021/dsa-5004
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://x-stream.github.io/CVE-2021-39150.html