{"id":"CVE-2021-31805","published":"2022-04-12T15:25:11Z","modified":"2024-08-03T23:10:30Z","title":"Forced OGNL evaluation, when evaluated on raw not validated user input in tag attributes, may lead to RCE.","vendor":"Apache Software Foundation","product":"Apache Struts","tier":"core","eol":null,"affectedVersions":[{"vendor":"Apache Software Foundation","product":"Apache Struts","versions":["2.0.0 to 2.5.29"]}],"description":{"text":"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.","provenance":"source","from":"CVE.org"},"summary":null,"cvss":null,"epss":{"score":0.85433,"percentile":0.99719,"date":"2026-10-29","provenance":"source"},"kev":null,"vulncheckKev":{"dateAdded":"2022-05-11","exploitedFirstSeen":"2022-05-11","ransomware":false,"evidence":[{"url":"https://blog.netlab.360.com/public-cloud-threat-intelligence-202204/","date":"2022-05-11"},{"url":"https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2023/11/09055246/Modern-Asian-APT-groups-TTPs_report_eng.pdf","date":"2023-11-09"},{"url":"https://veriti.ai/blog/vulnerable-villain-when-hackers-get-hacked/","date":"2024-04-15"},{"url":"https://previdian.com/CVE-2021-31805","date":"2026-06-12"}],"evidenceTotal":4,"provenance":"source"},"exploited":true,"otx":{"pulseCount":7,"pulses":[{"name":"Mirai, RAR1Ransom, and GuardMiner – Multiple Malware Campaigns Target VMware Vulnerability","url":"https://otx.alienvault.com/pulse/63579137c1103ef3aec3b272","created":"2022-10-25"},{"name":"Fortinet | multiple-malware-campaigns-target-vmware-vulnerability","url":"https://otx.alienvault.com/pulse/6356c8b4eb4f28638a6ee358","created":"2022-10-24"},{"name":"Mirai, RAR1Ransom, and GuardMiner – Multiple Malware Campaigns Target VMware Vulnerability","url":"https://otx.alienvault.com/pulse/6356c7f833f28e954ce8a98c","created":"2022-10-24"},{"name":"2022 UNIT 42 NETWORK THREAT TRENDS RESEARCH REPORT","url":"https://otx.alienvault.com/pulse/630e439ea98624c5bb1d4545","created":"2022-08-30"},{"name":"Public Cloud Cybersecurity Threat Intelligence (202204)","url":"https://otx.alienvault.com/pulse/627c18b2fef8aa8b755223c3","created":"2022-05-11"},{"name":"Critical RCE Bug in Struts 2 Framework for Java Applications Fully Fixed by Apache","url":"https://otx.alienvault.com/pulse/6267f92fcb577c565eff882f","created":"2022-04-26"},{"name":"ACTUALIZACION | El uso de una evaluación forzada del lenguaje de navegación de gráficos de objetos (OGNL) | F5","url":"https://otx.alienvault.com/pulse/625c612d0cb32a5afc6754b2","created":"2022-04-17"}],"provenance":"machine"},"cwes":[{"id":"CWE-917","name":"Improper Neutralization of Special Elements used in an Expression Language Statement"}],"references":[{"url":"https://cwiki.apache.org/confluence/display/WW/S2-062","tags":["x_refsource_MISC"]},{"url":"http://www.openwall.com/lists/oss-security/2022/04/12/6","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://www.oracle.com/security-alerts/cpujul2022.html","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20220420-0001/","tags":["x_refsource_CONFIRM"]}],"techniques":[],"reports":[],"affected":[{"ecosystem":"Maven","package":"org.apache.struts:struts2-core","vulnerableRanges":[">=2.0.0, <2.5.30"],"patched":["2.5.30"],"from":["GHSA-v8j6-6c2r-r27c"],"provenance":"source"}],"advisories":[{"id":"GHSA-v8j6-6c2r-r27c","url":"https://github.com/advisories/GHSA-v8j6-6c2r-r27c","severity":"CRITICAL","ecosystem":"Maven","package":"org.apache.struts:struts2-core","vulnerableRanges":[">=2.0.0, <2.5.30"],"patched":["2.5.30"],"provenance":"source","from":"GHSA"}],"euvd":{"id":"EUVD-2022-1835","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-1835","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":{"pocGithub":{"count":8,"skipped":0,"earliest":"2022-04-15","earliestUrl":"https://github.com/pyroxenites/s2-062","repos":[{"name":"pyroxenites/s2-062","url":"https://github.com/pyroxenites/s2-062","stars":131,"created":"2022-04-15"},{"name":"Wrin9/CVE-2021-31805","url":"https://github.com/Wrin9/CVE-2021-31805","stars":37,"created":"2022-04-15"},{"name":"jax7sec/S2-062","url":"https://github.com/jax7sec/S2-062","stars":23,"created":"2022-04-15"},{"name":"SecNN/Struts2_S2-062_CVE-2021-31805","url":"https://github.com/SecNN/Struts2_S2-062_CVE-2021-31805","stars":11,"created":"2022-04-15"},{"name":"aeyesec/CVE-2021-31805","url":"https://github.com/aeyesec/CVE-2021-31805","stars":5,"created":"2022-04-15"}]},"nuclei":[{"id":"CVE-2021-31805","name":"Apache Struts2 S2-062 - Remote Code Execution","severity":"critical","path":"http/cves/2021/CVE-2021-31805.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-31805.yaml"}],"first":{"date":"2022-04-15","source":"PoC-in-GitHub","url":"https://github.com/pyroxenites/s2-062"},"provenance":"source"},"exploitRefs":[],"flow":[],"timeline":[{"date":"2022-04-12","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2021-31805","provenance":"source"},{"date":"2022-04-15","kind":"exploit-public","label":"First public exploit: PoC-in-GitHub","url":"https://github.com/pyroxenites/s2-062","provenance":"source"},{"date":"2022-05-11","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://blog.netlab.360.com/public-cloud-threat-intelligence-202204/","provenance":"source"}],"speed":{"daysToPublicExploit":3,"firstExploitFrom":"PoC-in-GitHub","daysToKev":null},"priority":{"score":62.0,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 1633 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.94,"detail":"percentile 0.9972"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"8 PoC-in-GitHub repos; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":2.05,"detail":"7 pulses"},{"name":"CVSS severity","points":0.0,"detail":"no CVSS"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"familyId":"fam-apache-struts-cve-2020-17530","parents":[{"from":"CVE-2020-17530","to":"CVE-2021-31805","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"The fix issued for CVE-2020-17530 was incomplete.","from":"CVE.org","in":"CVE-2021-31805"},{"kind":"version-step","provenance":"source","package":"Maven:org.apache.struts:struts2-core","fromFixed":"2.5.26","toFixed":"2.5.30","daysApart":487},{"kind":"similar","provenance":"machine","score":0.71,"basis":"same product + CWE + description similarity"}]}],"packageHistory":[{"cve":"CVE-2019-0230","published":"2020-09-14","fixed":"2.5.22","kev":false},{"cve":"CVE-2019-0233","published":"2020-09-14","fixed":"2.5.22","kev":false},{"cve":"CVE-2020-17530","published":"2020-12-11","fixed":"2.5.26","kev":true},{"cve":"CVE-2021-31805","published":"2022-04-12","fixed":"2.5.30","kev":false},{"cve":"CVE-2025-68493","published":"2026-01-11","fixed":"6.1.1","kev":false},{"cve":"CVE-2023-34149","published":"2023-06-14","fixed":"6.1.2.1","kev":false,"link":{"from":"CVE-2021-31805","to":"CVE-2023-34149","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.apache.struts:struts2-core","fromFixed":"2.5.30","toFixed":"2.5.31","daysApart":428}]}},{"cve":"CVE-2023-34396","published":"2023-06-14","fixed":"6.1.2.1","kev":false,"link":{"from":"CVE-2021-31805","to":"CVE-2023-34396","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.apache.struts:struts2-core","fromFixed":"2.5.30","toFixed":"2.5.31","daysApart":428}]}}],"package":"Maven:org.apache.struts:struts2-core"}}