CVE-2021-29505: XStream is vulnerable to a Remote Command Execution attack

Published May 14, 2021
·
Updated

Impact The vulnerability may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user is affected, who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types.

Patches If you rely on XStream's default blacklist of the Security Framework, you will have to use at least version 1.4.17.

Workarounds See workarounds for the different versions covering all CVEs.

References See full information about the nature of the vulnerability and the steps to reproduce it in XStream's documentation for CVE-2021-29505.

Credits

V3geB1rd, white hat hacker from Tencent Security Response Center found and reported the issue to XStream and provided the required information to reproduce it.

For more information If you have any questions or comments about this advisory: Open an issue in XStream Email us at XStream Google Group

Other sources

A flaw was found in XStream. By manipulating the processed input stream, a remote attacker may be able to obtain sufficient rights to execute commands. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

The vulnerability may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user is affected, who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types.

Reference: https://github.com/x-stream/xstream/security/advisories/GHSA-7chv-rrw6-w6fc

Red Hat

XStream is software for serializing Java objects to XML and back again. A vulnerability in XStream versions prior to 1.4.17 may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types is affected. The vulnerability is patched in version 1.4.17.

Affected Software

47 affected componentsFixes available
redhat/xstream<0:1.3.1-14.el7_9
0:1.3.1-14.el7_9
debian/libxstream-java
1.4.11.1-1+deb10u31.4.11.1-1+deb10u41.4.15-3+deb11u21.4.20-1
redhat/xstream<1.4.17
1.4.17
Xstream Project Xstream<1.4.17
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=33
Fedoraproject Fedora=34
Fedoraproject Fedora=35
NetApp Snapmanager Oracle
NetApp Snapmanager Sap
Oracle Banking Cash Management=14.2
Oracle Banking Cash Management=14.3
Oracle Banking Cash Management=14.5
Oracle Banking Corporate Lending Process Management=14.2.0
Oracle Banking Corporate Lending Process Management=14.3.0
Oracle Banking Corporate Lending Process Management=14.5.0
Oracle Banking Credit Facilities Process Management=14.2.0
Oracle Banking Credit Facilities Process Management=14.3.0
Oracle Banking Credit Facilities Process Management=14.5.0
Oracle Banking Supply Chain Finance=14.2.0
Oracle Banking Trade Finance Process Management=14.5.0
Oracle Business Activity Monitoring=11.1.1.9.0
Oracle Business Activity Monitoring=12.2.1.3.0
Oracle Business Activity Monitoring=12.2.1.4.0
Oracle Communications Brm - Elastic Charging Engine=11.3
Oracle Communications Brm - Elastic Charging Engine=12.0
Oracle Communications Unified Inventory Management=7.3.4
Oracle Communications Unified Inventory Management=7.3.5
Oracle Communications Unified Inventory Management=7.4.0
Oracle Communications Unified Inventory Management=7.4.1
Oracle Communications Unified Inventory Management=7.4.2
Oracle Enterprise Manager Ops Center=12.4.0.0
Oracle Retail Xstore Point of Service=16.0.6
Oracle Retail Xstore Point of Service=17.0.4
Oracle Retail Xstore Point of Service=18.0.3
Oracle Retail Xstore Point of Service=19.0.2
Oracle Retail Xstore Point of Service=20.0.1
Oracle WebCenter Portal=12.2.1.3.0
Oracle WebCenter Portal=12.2.1.4.0
Oracle WebCenter Sites=12.2.1.3.0
Oracle WebCenter Sites=12.2.1.4.0
XStream XStream<1.4.17
Oracle Retail Customer Insights=15.0.2
Oracle Retail Customer Insights=16.0.2
maven/com.thoughtworks.xstream:xstream<1.4.17
1.4.17

Remediation

Information

Depending on the version of XStream used there are various usage patterns that mitigate this flaw, though we would strongly recommend using the allow list approach if at all possible as there are likely more class combinations the deny list approach may not address. Allow list approach ```java XStream xstream = new XStream(); XStream.setupDefaultSecurity(xstream); xstream.allowTypesByWildcard(new String[] {"com.misc.classname"}) ``` Deny list for XStream 1.4.16 (this should also address some previous flaws found in 1.4.7 - > 1.4.15) ```java xstream.denyTypesByRegExp(new String[]{ ".*\\.Lazy(?:Search)?Enumeration.*", "(?:java|sun)\\.rmi\\..*" }); ``` Deny list for XStream 1.4.15 ```java xstream.denyTypes(new String[]{ "sun.awt.datatransfer.DataTransferer$IndexOrderComparator", "sun.swing.SwingLazyValue", "com.sun.corba.se.impl.activation.ServerTableEntry", "com.sun.tools.javac.processing.JavacProcessingEnvironment$NameProcessIterator" }); xstream.denyTypesByRegExp(new String[]{ ".*\\$ServiceNameIterator", "javafx\\.collections\\.ObservableList\\$.*", ".*\\.bcel\\..*\\.util\\.ClassLoader" }); xstream.denyTypeHierarchy(java.io.InputStream.class ); xstream.denyTypeHierarchy(java.nio.channels.Channel.class ); xstream.denyTypeHierarchy(javax.activation.DataSource.class ); xstream.denyTypeHierarchy(javax.sql.rowset.BaseRowSet.class ); ``` Deny list for XStream 1.4.13 ```java xstream.denyTypes(new String[]{ "javax.imageio.ImageIO$ContainsFilter" }); xstream.denyTypes(new Class[]{ java.lang.ProcessBuilder.class }); ``` Deny list for XStream 1.4.7 -> 1.4.12 ```java xstream.denyTypes(new String[]{ "javax.imageio.ImageIO$ContainsFilter" }); xstream.denyTypes(new Class[]{ java.lang.ProcessBuilder.class, java.beans.EventHandler.class, java.lang.ProcessBuilder.class, java.lang.Void.class, void.class }); ``` Deny list for versions prior to XStream 1.4.7 ```java xstream.registerConverter(new Converter() { public boolean canConvert(Class type) { return type != null && (type == java.beans.EventHandler.class || type == java.lang.ProcessBuilder.class || type == java.lang.Void.class || void.class || type.getName().equals("javax.imageio.ImageIO$ContainsFilter") || Proxy.isProxy(type)); } public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { throw new ConversionException("Unsupported type due to security reasons."); } public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { throw new ConversionException("Unsupported type due to security reasons."); } }, XStream.PRIORITY_LOW); ```

Event History

May 14, 2021
CVE Published
12:00 AM
May 18, 2021
Advisory Published
via GitHub·06:36 PM
May 28, 2021
CVE Published
via MITRE·09:00 PM
Data Sourced
via MITRE·09:00 PM
DescriptionSeverityWeakness
Jun 1, 2021
Data Sourced
via Red Hat·06:45 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-29505?

CVE-2021-29505 is a vulnerability in XStream, a software for serializing Java objects to XML, which allows a remote attacker to execute commands by manipulating the input stream.

2

What is the severity of CVE-2021-29505?

The severity of CVE-2021-29505 is high with a CVSS score of 8.8.

3

Which versions of XStream are affected by CVE-2021-29505?

Versions of XStream prior to 1.4.17 are affected by CVE-2021-29505.

4

How can I fix CVE-2021-29505?

To fix CVE-2021-29505, it is recommended to update XStream to version 1.4.17 or later.

5

Where can I find more information about CVE-2021-29505?

You can find more information about CVE-2021-29505 on the GitHub security advisory and the Red Hat Bugzilla page.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203