Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 03 Apr 2017 13:55:17 +0200
From: Jörg Schaible <>
Subject: CVE Request - XStream: DoS when unmarshalling void


XStream is a Java library basically to marshal Java objects into XML and 

Huawei engineers reported a reproducible crash of the Java VM (DoS) feeding 
XStream with a specially crafted XML (note, that Stream also supports JSON, 
that one can be used equally).

Issue Description

The processed stream at unmarshalling type contains type information to 
recreate the formerly written objects. XStream creates therefore new 
instances based on these type information. The crash occurrs if this 
information advices XStream to create an instance of the primitive type 
'void'. This situation can only happen if an attacker was able to manipulate 
the incoming data, since such an instance does not exist.

Steps to Reproduce:

The simplest way to demonstrate the problem is with this snippet:

XStream xstream = new XStream();

If XStream is configured to read JSON, the equivalent line is:


However, the problematic type information can be injected at any position in 
the provided stream, in XML just by adding a class attribute:

xstream.fromXML("<string class='void'>Hello, world!</string>");

The vulnerability may allow a remote attacker to cause a crash on the target 
system resulting in a denial of service only by manipulating the processed 
input stream.

Affected Versions:
Currently all versions until and including version 1.4.9 are affected, but 
workarounds exist.

XStream contains since version 1.4.7 a security framework to prevent an 
attack described in CVE-2013-7285. This framework can also be used to 
suppress the current vulnerability by setting:

xstream.denyTypes(void.class, Void.class);

Users of older XStream releases can register an own converter for the 'void' 
type, that also protects against this attack:

xstream.registerConverter(new Converter() {
  public boolean canConvert(Class type) {
    return Void.class == type || void.class == type;
  public Object unmarshal(HierarchicalStreamReader reader, 
UnmarshallingContext context) {
    throw new ConversionException("Type void cannot have an instance");
  public void marshal(Object source, HierarchicalStreamWriter writer, 
MarshallingContext context) {
    throw new ConversionException("Type void cannot have an instance");

Jörg Schaible

Maintainer of XStream.

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.