Description
The fix issued for CVE-2020-17530 was incomplete. So from Apache Struts 2.0.0 to 2.5.29, still some of the tag’s attributes could perform a double evaluation if a developer applied forced OGNL evaluation by using the %{...} syntax. Using forced OGNL evaluation on untrusted user input can lead to a Remote Code Execution and security degradation.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Apache Software Foundation | Apache Struts | 2.0.0 to 2.5.29 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 8 repositories
-
pyroxenites/s2-062 ★ 131 · Apr 15, 2022
远程代码执行S2-062 CVE-2021-31805验证POC
-
Wrin9/CVE-2021-31805 ★ 37 · Apr 15, 2022
S2-062 (CVE-2021-31805) / S2-061 / S2-059 RCE
-
jax7sec/S2-062 ★ 23 · Apr 15, 2022
Apache Struts2 S2-062远程代码执行漏洞(CVE-2021-31805) 支持批量扫描漏洞及漏洞利用
-
SecNN/Struts2_S2-062_CVE-2021-31805 ★ 11 · Apr 15, 2022
Apache Struts2 S2-062远程代码执行漏洞(CVE-2021-31805) | 反弹Shell
-
z92g/CVE-2021-31805 ★ 5 · Jul 10, 2022
S2-061/S2-062 Struts2 远程命令执行漏洞 POC&EXP
-
aeyesec/CVE-2021-31805 ★ 5 · Apr 15, 2022
PoC for CVE-2021-31805 (Apache Struts2)
-
JordanANDJohn/CVE-2021-31805-POC ★ 1 · Apr 18, 2022
Apache Struts2 S2-062(CVE-2021-31805)远程代码执行批量检测(无利用)
-
nth347/struts2-CVE-2021-31805 ★ 0 · Aug 4, 2023
Vulnerable environment of CVE-2021-31805 (S2-062) for testing
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- Apache Struts2 S2-062 - Remote Code Execution http/cves/2021/CVE-2021-31805.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Maven | org.apache.struts:struts2-core | >= 2.0.0, < 2.5.30 | 2.5.30 | GHSA-v8j6-6c2r-r27c |
Advisories 4
- WID-SEC-2026-2893 Oracle Hyperion: Mehrere Schwachstellen BSI CERT-Bund (WID) · Aug 18, 2026
- WID-SEC-2022-0735 Oracle MySQL: Mehrere Schwachstellen BSI CERT-Bund (WID) · May 19, 2026
- WID-SEC-2022-0815 Apache Struts: Schwachstelle ermöglicht Ausführen von beliebigem Programmcode mit den Rechten des Dienstes BSI CERT-Bund (WID) · Feb 6, 2023
- WID-SEC-2023-0130 Oracle Hyperion: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jan 17, 2023
References
- https://cwiki.apache.org/confluence/display/WW/S2-062
- [oss-security] 20220412 CVE-2021-31805: Apache Struts: Forced OGNL evaluation, when evaluated on raw not validated user input in tag attributes, may lead to RCE. mailing-list
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://security.netapp.com/advisory/ntap-20220420-0001/