Lucene search

K
redhatcveRedhat.comRH:CVE-2021-29505
HistoryJun 01, 2021 - 7:12 p.m.

CVE-2021-29505

2021-06-0119:12:54
redhat.com
access.redhat.com
27

8.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

6.5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:S/C:P/I:P/A:P

0.048 Low

EPSS

Percentile

92.6%

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.

Mitigation

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);  

8.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

6.5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:S/C:P/I:P/A:P

0.048 Low

EPSS

Percentile

92.6%