Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
HighCISA KEVExploited in the wildPublic exploit

Apache Struts REST Plugin XStream XML Deserialization RCE

IdentifiersCVE-2017-9805CWE-502· Deserialization of Untrusted Data

CVE-2017-9805 is a critical remote code execution vulnerability in the Apache Struts 2 REST Plugin. In affected Struts versions, the REST plugin's XStreamHandler uses an instance of XStream to deserialize attacker-controlled XML request bodies without sufficient type filtering or class restrictions. Because untrusted XML is deserialized into arbitrary object graphs, a remote attacker can supply a crafted XML payload that triggers unsafe deserialization behavior and results in code execution in the context of the Struts application. The issue affects Apache Struts 2.1.1 through 2.3.x before 2.3.34 and 2.5.x before 2.5.13; advisory detail in the provided content also specifies affected ranges as 2.1.6 through 2.3.33 and 2.5 through 2.5.12.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows a remote, unauthenticated attacker to execute arbitrary code on the target server with the privileges of the Struts application process. This can lead to full compromise of the application, deployment of malware or web shells, theft of sensitive data, lateral movement, persistence, and potentially broader system compromise depending on the application's privileges and host configuration.

Mitigation

If you can’t patch tonight, do this now.

If the Struts REST plugin is not required, remove it. If the plugin is required but XML support is not, disable XML request and page handling and restrict the plugin to normal pages and JSON only, for example by excluding XML from the struts.action.extension configuration. Another mitigation described in the advisory is to override XStreamHandler behavior, including getContentType handling, to prevent XML processing, and register a custom content type handler in struts.xml. These measures reduce exposure but do not replace patching.

Remediation

Patch, then assume compromise.

Upgrade Apache Struts to a fixed release: 2.3.34 or later on the 2.3.x branch, or 2.5.13 or later on the 2.5.x branch. If a full framework upgrade is not immediately possible, Apache also indicated that users may upgrade the REST plugin and required dependencies specifically, provided compatibility is validated. Review any REST actions after patching because the security fix introduces class restriction mechanisms that may require explicit allowlisting via interfaces such as AllowedClasses, AllowedClassNames, or XStreamPermissionProvider.
PUBLIC EXPLOITS

Exploits

7 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (3 hidden).

VALID 7 / 10 TOTALView more in app
struts-s2-052-deserialization-rce-labMaturityPoCVerified exploit

This repository is a small standalone proof-of-concept exploit for Apache Struts S2-052 XML deserialization RCE (CVE-2017-9805). The main file, exploit.py, is a Python 3 script using the requests library to POST a crafted application/xml body to a user-specified target URL. The XML payload is a malicious XStream object graph that reaches java.lang.ProcessBuilder and invokes start(), executing an operator-controlled shell command through /bin/sh -c on the remote server. The script itself is simple and operational: it accepts two arguments (target URL and command), sends the exploit, and prints the HTTP status code and response length. Repository structure is minimal: README.md documents the vulnerability, affected Struts versions, and exploitation concept; exploit.py contains the actual exploit logic; detection.xml, payload.xml, and reverse-shell.xml are helper payload examples showing command arrays for touch /tmp/pwned, whoami, and a bash reverse shell respectively. There is no framework integration, no target discovery logic, and no automated listener or session handling. The exploit capability is direct unauthenticated remote command execution against vulnerable Struts REST endpoints that deserialize XML. Because the command is operator-supplied and the repository includes a reverse shell template, the code is more than a pure POC but still basic and hardcoded enough to classify as OPERATIONAL rather than weaponized.

Experience-rookieDisclosed Mar 16, 2026pythonxmlnetwork
CVE-2017-9805-S2-052MaturityPoCVerified exploit

Repository contains a minimal proof-of-concept exploit for Apache Struts2 S2-052 (CVE-2017-9805) implemented as a single Python script plus a short README. Structure: - README.md: states this is an S2-052 PoC and shows how to run it. - struts20179805.py: standalone Python3 exploit that crafts a raw HTTP request and sends it over TLS. How it works: - Builds a raw HTTP/1.1 PUT request with Content-Type: application/xml and a hardcoded JSESSIONID cookie. - The request body is a known XStream deserialization gadget chain (using classes like javax.imageio.ImageIO$ContainsFilter and java.lang.ProcessBuilder) intended to trigger server-side deserialization and execute an OS command. - Payload is lab-specific: executes /usr/local/bin/score UUID. - Sends the packet to a hardcoded host over HTTPS (port 443) with TLS verification disabled. - Reads the full response and prints the first 1000 bytes; uses simple heuristics: - If HTTP 500 is present and "ContainsFilter" is not, it reports likely execution. - If "ContainsFilter" appears, it reports an XStream field error (no execution). Notable limitations/assumptions: - Target host and URI are hardcoded (host: ptl-...libcurl.me, uri: /orders/3). - Cookie and UUID are hardcoded placeholders; comments instruct manual editing. - No interactive shell; only executes a fixed command (operational but not highly flexible).

7s26simonDisclosed Feb 28, 2026pythonnetwork
CVE-2017-9805MaturityPoCVerified exploit

This repository contains a proof-of-concept (POC) exploit for CVE-2017-9805, a critical remote code execution vulnerability in the Apache Struts 2 REST plugin due to unsafe Java deserialization. The main file, 'CVE-2017-9805.py', is a Python script that sends a specially crafted XML payload to a user-specified URL (the vulnerable endpoint). The payload leverages Java deserialization to execute arbitrary system commands on the target server using ProcessBuilder. The script allows the user to specify the target URL and command, but the payload must be manually edited to insert the desired command or reverse shell. The README provides a brief description of the vulnerability. No hardcoded endpoints are present; the target is specified at runtime. The exploit is a standalone POC and not part of a larger framework.

Shakun8Disclosed Oct 3, 2022pythonnetwork
struts-pwn_CVE-2017-9805MaturityPoCVerified exploit

This repository contains a Python exploit script (struts-pwn.py) targeting Apache Struts 2 REST plugin vulnerability CVE-2017-9805. The exploit works by sending a specially crafted XML payload to a target URL, exploiting a Java deserialization flaw to achieve remote code execution via ProcessBuilder. The script supports both single and batch URL targeting, with options to check for vulnerability or execute arbitrary commands (default: 'touch /tmp/struts-pwn'). The README provides usage instructions and example endpoints. The only code file is struts-pwn.py, which is self-contained and requires Python and the requests library. The exploit is operational and can be used to verify and exploit vulnerable Struts 2 instances accessible over HTTP(S).

mazen160Disclosed Sep 9, 2017pythonnetwork
struts-rce-cve-2017-9805MaturityPoCVerified exploit

This repository is a Go-based exploit tool targeting Apache Struts servers vulnerable to CVE-2017-9805 (Java deserialization RCE in the REST plugin). The main file, main.go, provides two primary modes: (1) direct exploitation of a single target by sending a crafted XML payload that executes an arbitrary command, and (2) batch mode, which reads a list of targets from a file, sends a payload to each that attempts to execute a curl command back to the attacker's listener, and confirms exploitation by receiving callbacks. The tool uses a custom XML payload to trigger the vulnerability and supports user-supplied commands. It also determines the attacker's external IP using http://checkip.amazonaws.com for callback payload construction. The code is operational and can be used to both exploit and verify RCE on vulnerable Struts instances. The repository contains a README with usage instructions and a single Go source file implementing the exploit logic.

luc10Disclosed Sep 6, 2017gonetwork
-CVE-2017-9805MaturityPoCVerified exploit

This repository contains a Python exploit script (s2-052.py) targeting the Apache Struts2 S2-052 (CVE-2017-9805) vulnerability, which is a remote code execution flaw in the XStream REST plugin. The exploit works by crafting a malicious XML payload that leverages Java deserialization to execute arbitrary shell commands on the target server. The script takes a target URL and a command to execute, parses the target to extract the IP, port, and URI, and sends the exploit as an HTTP POST request. The README provides usage instructions and a demonstration, including example IP addresses and endpoints. The exploit is operational, allowing attackers to run arbitrary commands on vulnerable servers. The repository consists of two files: a README.md with documentation and s2-052.py containing the exploit logic. The main entry point is s2-052.py, written in Python, and the attack vector is network-based, requiring access to the vulnerable HTTP endpoint.

0x00-0x00Disclosed Nov 24, 2017pythonnetwork
cve-2017-9805.pyMaturityPoCVerified exploit

This repository contains a single Python exploit script (cve-2017-9805.py) targeting CVE-2017-9805, a remote code execution vulnerability in Apache Struts 2.5-2.5.12 with the REST plugin. The exploit improves upon previous public scripts by using proper XML encoding, argument parsing, and command injection handling. The script takes a target URL and a command to execute, crafts a malicious XML payload with the command base64-encoded, and sends it via an HTTP POST request to the specified Struts endpoint. Upon successful exploitation, the command is executed on the target server. The repository also includes a README describing the improvements and a standard MIT license. The main attack vector is network-based, requiring access to a vulnerable Struts HTTP endpoint. The script is operational and suitable for demonstrating the vulnerability or for penetration testing with proper authorization.

chrisjd20Disclosed Dec 4, 2017pythonnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Apache Software FoundationStrutsapplication
Cisco SystemsDigital Media Managerapplication
Cisco SystemsHosted Collaboration Solutionapplication
Cisco SystemsMedia Experience Engineapplication
Cisco SystemsNetwork Performance Analysisapplication
Cisco SystemsVideo Distribution Suite For Internet Streamingapplication
NetAppOncommand Balanceapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures2

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity1

Community discussion across Reddit, Mastodon, and other social sources.