You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Summary

A possible Remote Code Execution attack when using an expression in Freemarker tag instead of string literals

Who should read this

All Struts 2 developers and users

Impact of vulnerability

A RCE attack is possible when developer is using wrong construction in Freemarker tags

Maximum security rating

Critical

Recommendation

Upgrade to Struts 2.5.12 or Struts 2.3.34

Affected Software

Struts 2.1.2 - Struts 2.3.33, Struts 2.5 - Struts 2.5.10

Reporter

Lupin <lupin1314 at gmail dot com> - jd.com security team

CVE Identifier

 

Problem

The REST Plugin is using a XStreamHandler with an instance of XStream for deserialization without any type filtering and this can lead to Remote Code Execution when deserializing XML payloads.

Solution

Upgrade to Apache Struts version 2.5.13 or 2.3.34.

Backward compatibility

It is possible that some REST actions stop working because of applied default restrictions on available classes. In such case please investigate the new interfaces that was introduced to allow define class restrictions per action, those interfaces are:

  • org.apache.struts2.rest.handler.AllowedClasses
  • org.apache.struts2.rest.handler.AllowedClassNames
  • org.apache.struts2.rest.handler.XStreamPermissionProvider

Workaround

The best option is to remove the Struts REST plugin when not used. Alternatively you can only upgrade the plugin by dropping in all the required JARs (plugin plus all dependencies).  Another options is to limit th plugin to server normal pages and JSONs only:

<constant name="struts.action.extension" value="xhtml,,json" />

 

 

  • No labels