Struts ParameterInterceptor vulnerability allows remote command execution
Critical severity
GitHub Reviewed
Published
Apr 22, 2022
to the GitHub Advisory Database
•
Updated Aug 16, 2023
Package
Affected versions
>= 2.0.0, < 2.3.1.2
Patched versions
2.3.1.2
Description
Published by the National Vulnerability Database
Nov 1, 2019
Published to the GitHub Advisory Database
Apr 22, 2022
Reviewed
Nov 3, 2022
Last updated
Aug 16, 2023
Regular expression in ParametersInterceptor matches
top['foo'](0)
as a valid expression, which OGNL treats as(top['foo'])(0)
and evaluates the value of 'foo' action parameter as an OGNL expression. This lets malicious users put arbitrary OGNL statements into any String variable exposed by an action and have it evaluated as an OGNL expression and since OGNL statement is in HTTP parameter value attacker can use blacklisted characters (e.g. #) to disable method execution and execute arbitrary methods, bypassing the ParametersInterceptor and OGNL library protections.References