Vulnerability library
Security checkMay 13, 2024

Apache Struts 2 Forced double OGNL evaluation S2-059

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severityRCEStrutsInjection

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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).

Recommendation

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.

References

Could your website be exposed too?

SmartScanner can check your website for Apache Struts 2 Forced double OGNL evaluation S2-059 and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated May 13, 2024