# Apache Struts 2 Showcase Remote Code Execution (CVE-2017-9791)

**URL:** <https://community.f5.com/t/apache-struts-2-showcase-remote-code-execution-cve-2017-9791/66723>\
**Category:** F5 Technical Articles\
**Tags:** big-ip, asm-advanced-waf, security, cve-2017-9791\
**Created:** [July 11, 2017, 1:24pm UTC](https://community.f5.com/t/apache-struts-2-showcase-remote-code-execution-cve-2017-9791/66723 "2017-07-11T13:24:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gal\_Goldshtein](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@Gal\_Goldshtein](https://community.f5.com/u/Gal_Goldshtein)\
**Post date:** [July 11, 2017, 1:24pm UTC](https://community.f5.com/t/apache-struts-2-showcase-remote-code-execution-cve-2017-9791/66723/1 "2017-07-11T13:24:00Z")

</div>

In the recent days a new Apache Struts 2 vulnerability was published ([S2-048](https://cwiki.apache.org/confluence/display/WW/S2-048)) ([CVE-2017-9791](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9791)) and a POC code exploiting it was publicly released. The vulnerability lies in the Apache Stratus 2.3.x Showcase application when using the Struts 2 Struts 1 plugin which allows developers to use Struts 1 _Action_&nbsp;and _ActionForm_&nbsp;objects in Struts 2 applications. The application is using untrusted user input as part of a message presented to the user in the _ActionMessage_ class which is the root cause of this vulnerability.

## **Mitigation with BIG-IP ASM**

ASM customers under any supported BIG-IP version&nbsp;are already protected against this vulnerability.

While exploiting this vulnerability attacker will try to send a malicious HTTP POST request containing multiple JAVA code injections and _Object Graph Navigation Library_ expressions injections.

 ![image_283128.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/e/a/ea07b25971308ff0c3d5b9c74ce085aa143e945d.png)  
**Figure 1:** &nbsp;_Request example containing the exploitation attempt_

The exploitation attempt will be detected by many existing Java Code Injection, Object Graph Navigation Library expressions and several OS command execution attack signatures which can be found in signature sets that include “Command Execution” and “Server Side Code Injection” attack types or “Java Servlets/JSP” system.

 ![image_283128.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/3/e/3e5c3e74338044c199fb762d076729ac7f0b9274.png)

**Figure 2:** &nbsp;_Exploit blocked with Attack Signature (200004224)_

 ![image_283128.png](https://d20hrnpixdzcsd.cloudfront.net/original/2X/d/d76003d52055cbf2f4a988da82b99cfe84df1aea.png)

**Figure 3:** &nbsp;_Exploit blocked with Attack Signature (200003458)_

 ![image_283128.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/0/9/09f0f2d673c3b4496a0543bb9787b70458a1b13c.png)

**Figure 4:** &nbsp;_Exploit blocked with Attack Signature (200003470)_
