Home > Security Bulletins > S2-036

Summary

Forced double OGNL evaluation, when evaluated on raw user input in tag attributes, may lead to remote code execution (similar to S2-029)

Who should read this

All Struts 2 developers and users

Impact of vulnerability

Possible Remote Code Execution vulnerability

Maximum security rating

Medium

Recommendation

Always validate incoming parameters' values when re-assigning them to certain Struts' tags attributes.

Don't use %{...} syntax in tag attributes other than value unless you have a valid use-case.

Alternatively upgrade to Struts 2.3.29 or Struts 2.5.1

Affected Software

Struts 2.0.0 - Struts 2.3.28.1

Reporters

Alvaro Munoz alvaro dot munoz at hpe.com

CVE Identifier

CVE-2016-4461

Problem

The same issue was reported in S2-029 but the proposed solutions were not fully proper. The Apache Struts frameworks when forced, performs double evaluation of attributes' values assigned to certain tags so it is possible to pass in a value that will be evaluated again when a tag's attributes will be rendered.

Solution

Adding a proper validation of each value that's coming in and it's used in tag's attributes.

Don't use forced evaluation of an attribute other than value using %{...} syntax unless really needed for a valid use-case. 

By upgrading to Struts 2.3.29 or 2.5.1, possible malicious effects of forced double evaluation are limited.

Backward compatibility

Some backward incompatibility issues are expected when upgrading to Struts 2.3.29 - it can happen that some OGNL expressions stop working because of performing disallowed arithmetic operations and assigments.

Workaround

Not possible as this fix requires changes in OGNL and how Struts uses OGNL in certain aspects.