Code Injection in Apache Struts - CVE-2019-0230

 

Code Injection in Apache Struts - CVE-2019-0230

Published: August 14, 2020 / Updated: June 17, 2021


Vulnerability identifier: #VU45703
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2019-0230
CWE-ID: CWE-94
Exploitation vector: Remote access
Exploit availability: Public exploit is available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The Apache Struts frameworks, when forced, performs double evaluation of attributes' values assigned to certain tags attributes such as id so it is possible to pass in a value that will be evaluated again when a tag's attributes will be rendered. With a carefully crafted request, this can lead to Remote Code Execution (RCE).

The problem only applies when forcing OGNL evaluation inside a Struts tag attribute, when the expression to evaluate references raw, unvalidated input that an attacker is able to directly modify by crafting a corresponding request.

Example:

<s:url var="url" namespace="/employee" action="list"/><s:a id="%{skillName}" href="%{url}">List available Employees</s:a>

If an attacker is able to modify the skillName attribute in a request such that a raw OGNL expression gets passed to the skillName property without further validation, the provided OGNL expression contained in the skillName attribute gets evaluated when the tag is rendered as a result of the request.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

Apache Struts
Oracle Financial Services Data Integration Hub
Oracle Financial Services Market Risk Measurement and Management
eDiscovery Manager
Call Center for Commerce
IBM Sterling Order Management
IBM Sterling File Gateway

How to mitigate CVE-2019-0230

Install updates from vendor's website.

Apache Struts - update to 2.5.22
eDiscovery Manager - update to 2.2.2.3.8
IBM Sterling File Gateway - addressed in versions 5.2.6.5_3, 6.0.3.3, 6.1.0.0
Call Center for Commerce - update to 10.0.12
IBM Sterling Order Management - update to 10.0.2403.1

Links to Public Exploits and PoC-codes

External References

Related Security Bulletins