RHSA-2021:2683HighCVSS 7.5

Red Hat Security Advisory: xstream security update

Published
July 12, 2021
Last Modified
October 7, 2026

🔗 CVE IDs covered (1)

📋 Description

CVE-2021-29505 — XStream: remote command execution attack by manipulating the processed input stream

🎯 Affected products16

  • Red Hat Enterprise Linux Client Optional (v. 7)
  • Red Hat Enterprise Linux ComputeNode Optional (v. 7)
  • Red Hat Enterprise Linux Server Optional (v. 7)
  • Red Hat Enterprise Linux Workstation Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Client Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux ComputeNode Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Server Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Workstation Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.src as a component of Red Hat Enterprise Linux Client Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.src as a component of Red Hat Enterprise Linux ComputeNode Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.src as a component of Red Hat Enterprise Linux Server Optional (v. 7)
  • xstream-0:1.3.1-14.el7_9.src as a component of Red Hat Enterprise Linux Workstation Optional (v. 7)
  • xstream-javadoc-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Client Optional (v. 7)
  • xstream-javadoc-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux ComputeNode Optional (v. 7)
  • xstream-javadoc-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Server Optional (v. 7)
  • xstream-javadoc-0:1.3.1-14.el7_9.noarch as a component of Red Hat Enterprise Linux Workstation Optional (v. 7)

✅ Remediation

For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 Workaround: 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); ```

🔗 References (4)