CVE-2021-31805

CRITICAL EXPLOITED NUCLEI LAB

Apache Struts 2.0.0-2.5.29 - Remote Code Execution via Forced OGNL Evaluation

Title source: llm
STIX 2.1

Exploitation Summary

CVE-2021-31805 has been observed exploited in the wild (reported by VulnCheck KEV). EIP tracks 10 public exploits from researchers including pyroxenites, Wrin9, jax7sec. A Nuclei detection template is also available.

AI-analyzed exploit summary This repository contains a functional exploit PoC for CVE-2021-31805, a remote code execution vulnerability in Apache Struts2. The exploit leverages OGNL injection to execute arbitrary commands, demonstrated via DNS exfiltration and direct command execution payloads.

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.

Exploits (10)

nomisec WORKING POC 131 stars
by pyroxenites · remote
https://github.com/pyroxenites/s2-062

This repository contains a functional exploit PoC for CVE-2021-31805, a remote code execution vulnerability in Apache Struts2. The exploit leverages OGNL injection to execute arbitrary commands, demonstrated via DNS exfiltration and direct command execution payloads.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (versions affected by CVE-2021-31805)
No auth needed
Prerequisites: Target must be running a vulnerable version of Apache Struts2 · Network access to the target application
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 37 stars
by Wrin9 · remote
https://github.com/Wrin9/CVE-2021-31805

This repository contains a functional exploit for CVE-2021-31805, a remote code execution vulnerability in Apache Struts2 due to incomplete OGNL expression filtering. The PoC leverages a crafted multipart/form-data payload to execute arbitrary commands via OGNL injection.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts 2.0.0 - 2.5.29
No auth needed
Prerequisites: Target running vulnerable Apache Struts version · Network access to the target
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 23 stars
by jax7sec · remote
https://github.com/jax7sec/S2-062

This repository contains a functional exploit for CVE-2021-31805, an RCE vulnerability in Apache Struts2 (S2-062). The exploit leverages OGNL injection via a crafted multipart form-data payload to execute arbitrary commands on the target system.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (versions affected by S2-062/CVE-2021-31805)
No auth needed
Prerequisites: Target must be running a vulnerable version of Apache Struts2 · Network access to the target application
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 11 stars
by SecNN · poc
https://github.com/SecNN/Struts2_S2-062_CVE-2021-31805

This repository contains functional exploit code for CVE-2021-31805, an Apache Struts2 S2-062 remote code execution vulnerability. The exploit leverages OGNL injection to execute arbitrary commands via a crafted multipart/form-data payload.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (versions affected by S2-062)
No auth needed
Prerequisites: Target running vulnerable Apache Struts2 version · Network access to the target
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 6 stars
by z92g · poc
https://github.com/z92g/CVE-2021-31805

This repository contains a functional exploit for CVE-2021-31805, a Struts2 remote command execution vulnerability. The tool supports both DNS-based and direct command execution checks, with payloads tailored for S2-061 and S2-062 vulnerabilities.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (versions affected by S2-061 and S2-062)
No auth needed
Prerequisites: Target running vulnerable Struts2 version · Network access to the target
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 5 stars
by aeyesec · poc
https://github.com/aeyesec/CVE-2021-31805

This repository provides a functional Dockerized environment for exploiting CVE-2021-31805, an OGNL injection vulnerability in Apache Struts2. The PoC demonstrates arbitrary file deletion via crafted OGNL expressions in the `skillName` parameter.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (2.5.29)
No auth needed
Prerequisites: Docker environment · Network access to target Struts2 application
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 1 stars
by JordanANDJohn · poc
https://github.com/JordanANDJohn/CVE-2021-31805-POC

This repository contains a functional exploit PoC for CVE-2021-31805, an Apache Struts2 RCE vulnerability caused by incomplete OGNL evaluation fixes. The script sends a crafted multipart request with OGNL payloads to trigger remote code execution via freemarker.template.utility.Execute.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts 2.0.0 - 2.5.29
No auth needed
Prerequisites: Target running vulnerable Apache Struts version · Exposed endpoint accepting multipart form data
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec STUB
by nth347 · poc
https://github.com/nth347/CVE-2021-31805

The repository contains minimal Java code for a Tomcat setup and a basic Struts action class, but lacks any exploit logic or demonstration of CVE-2021-31805. No malicious or functional exploit code is present.

Classification
Stub 90%
Attack Type
Other
Complexity
Trivial
Reliability
Theoretical
Target: Apache Tomcat (version unspecified)
No auth needed
Prerequisites: None identified
devstral-2 · analyzed Feb 18, 2026 Full analysis →
vulncheck_xdb WORKING POC
remote
https://github.com/fleabane1/CVE-2021-31805-POC

This repository contains a functional exploit PoC for CVE-2021-31805, an Apache Struts2 RCE vulnerability caused by incomplete OGNL evaluation fixes. The script sends a crafted multipart request with OGNL payloads to trigger remote code execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts 2.0.0 - 2.5.29
No auth needed
Prerequisites: Apache Struts application with exposed vulnerable endpoint
devstral-2 · analyzed Feb 25, 2026 Full analysis →
vulncheck_xdb WORKING POC
remote
https://github.com/Axx8/Struts2_S2-062_CVE-2021-31805

This repository contains functional exploit code for CVE-2021-31805, an Apache Struts2 S2-062 remote code execution vulnerability. The exploit leverages OGNL injection to execute arbitrary commands on the target system, including command execution and reverse shell capabilities.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Apache Struts2 (versions affected by S2-062)
No auth needed
Prerequisites: Target running vulnerable Apache Struts2 version · Network access to the target
devstral-2 · analyzed Feb 25, 2026 Full analysis →

Nuclei Templates (1)

Apache Struts2 S2-062 - Remote Code Execution
CRITICALby taielab
Shodan: http.html:"apache struts" || http.title:"struts2 showcase" || http.html:"struts problem report"
FOFA: body="struts problem report" || title="struts2 showcase" || body="apache struts"

References (4)

Core 4
Core References
Mitigation, Patch, Vendor Advisory x_refsource_misc
https://cwiki.apache.org/confluence/display/WW/S2-062
Mailing List, Mitigation, Third Party Advisory mailing-list x_refsource_mlist
http://www.openwall.com/lists/oss-security/2022/04/12/6
Third Party Advisory x_refsource_confirm
https://security.netapp.com/advisory/ntap-20220420-0001/

Scores

CVSS v3 9.8
EPSS 0.9379
EPSS Percentile 99.9%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Details

VulnCheck KEV 2022-05-11
CWE
CWE-917
Status published
Products (2)
apache/struts 2.0.0 - 2.5.29
org.apache.struts/struts2-core 2.0.0 - 2.5.30Maven
Published Apr 12, 2022
Tracked Since Feb 18, 2026