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
- S2-059 - Apache Struts 2 Wiki
- Apache Struts
- CVE-2019-0230
- CWE-20
- CWE-78
- CAPEC-88
- CAPEC-310
- OWASP 2021-A3
- OWASP 2021-A6