Apache Struts 2 Forced double OGNL evaluation S2-059

Impact: High


The Apache Struts framework, when forced, performs double evaluation of attributes’ values assigned to certain tags attributes such as id. This allows attackers to pass in a value that will be evaluated again when a tag’s attributes are rendered. With a carefully crafted request, this vulnerability can lead to Remote Code Execution (RCE).


To mitigate this vulnerability, it is recommended to add proper validation of each value that’s coming in and used in tag’s attributes. Avoid using forced evaluation of an attribute other than value using %{…} or ${…} syntax unless really needed for a valid use-case. Additionally, upgrading to Struts 2.5.22 or newer versions can limit possible malicious effects of forced double evaluation, especially when combined with Proactive OGNL Expression Injection Protection.


Last updated on May 13, 2024

This issue is available in SmartScanner Professional

See Pricing