Apache Struts 2 CVE-2017-9805 Remote Code Execution

September 7, 2017

A critical vulnerability CVE-2017-9805 (S2-052) on Apache Struts 2 has been reported by security researchers form lgtm.com. This vulnerability is caused by the XStreamHandler in by the REST Plugin. During the process of deserializing the XML formatted packet, XStream failed to filter the file types. An attacker can send a certain crafted XML file to the target server and execute arbitrary code with the privelege of the current service.

The PoC of this vulnerability is already in the wild. By sending the following payload as application/xml, the calc.exe will be executed on the target host.

0 ...[truncated].../Applications/Calculator.app/Contents/MacOS/Calculator...[truncated]...

In this PoC, the "map" class contributed the dangerous methods.

From the patch code on Github (http://bit.ly/2eRD33v), white lists have been applied to the xml data, this is to prevent malicious class and methods been brought in during the processing.

And the filter was added before calling the XStream.fromXML method.

SonicWALL customers are protected against this threat via the following signature:

  • IPS 12968 Apache Struts 2 Insecure Deserialization