Apache Struts 2 RCE exploited in the wild (CVE-2016-3081)
CVE-2016-3081
CVE-2016-3081: Apache Struts 2.3.19-2.3.28 RCE via method: prefix when Dynamic Method Invocation is enabled (CVSS 9.3). Upgrade to Struts 2.3.29 or later.
Actively exploited in the wild - CVE-2016-3081 is a critical remote code execution flaw in Apache Struts 2.3.19 through 2.3.28 that lets unauthenticated attackers run arbitrary commands on the server when Dynamic Method Invocation is enabled. Upgrade to Struts 2.3.29 or later, or disable DMI immediately.
Overview
Apache Struts is a popular Java framework for building web applications. CVE-2016-3081 abuses a feature called Dynamic Method Invocation (DMI), which allows the method: prefix in URLs to call server-side methods directly. When DMI is enabled, a remote attacker can craft a request that chains expressions together and executes arbitrary code on the underlying server.
The vulnerability affects Struts 2.3.19 to 2.3.20.2, 2.3.21 to 2.3.24.1, and 2.3.25 to 2.3.28. Older branches and 2.3.29 and later are not affected by this specific issue. CISA added it to the Known Exploited Vulnerabilities catalog, confirming real-world attacks against unpatched systems.
Impact
Successful exploitation grants the attacker the same privileges as the application server process. That usually means the ability to read configuration files and database credentials, modify application data, install web shells, and pivot laterally into the internal network. Because no authentication or user interaction is required, any internet-facing Struts application with DMI enabled is directly exposed. The CVSS score of 9.3 reflects the severe confidentiality, integrity, and availability impact.
This class of Struts flaw has been repeatedly targeted at scale. Automated scanners still sweep for the method: pattern years after disclosure, so exposure does not require a targeted attacker.
Remediation and Mitigation
- Upgrade Apache Struts to 2.3.29 or later, which removes the vulnerable chained-expression handling.
- If you cannot patch immediately, disable Dynamic Method Invocation by setting
struts.enable.DynamicMethodInvocationtofalsein yourstruts.xmland redeploy. - Block requests containing the
method:prefix at your WAF or reverse proxy as a temporary control. - Restrict outbound network access from application servers to limit post-exploitation movement.
- Rotate any credentials stored in application configuration files, since exploitation may have already occurred.
Verify your Struts version with the struts2-core JAR in your deployment, not the version listed in your build file, because transitive dependencies often drift.
Security Insight
The Struts DMI flaw is a textbook case of a convenience feature becoming an attack surface: the same flexibility that let developers call methods from URLs also let attackers call whatever they wanted. It also previews the pattern that made the later Struts OGNL vulnerabilities so damaging, where years-old framework code kept resurfacing in breach reports long after patches existed. For defenders, the lesson is that framework-level features are rarely retired on their own, and inventorying Java dependencies remains the only reliable way to know if you are exposed. Teams tracking active framework abuse should also review Apache ActiveMQ CVE-2026-34197 added to CISA KEV catalo for a current example of the same exploitation dynamic.
Further Reading
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Am I Affected by CVE-2016-3081?
Pick an ecosystem, paste your installed version, and we'll compare it against the fixed version published on OSV.dev. Browser-only — nothing is sent to a server.
Heuristic comparison only. Always cross-check against the vendor advisory before making patching decisions.
Metasploit Modules
Weaponized exploit code — authorized use only
The Metasploit Framework modules below are production-ready exploit code maintained by Rapid7. Unlike random GitHub PoCs, these are vetted by Metasploit maintainers and integrated into a point-and-click exploitation framework used by red teams worldwide. The presence of an MSF module means this CVE is trivially exploitable at scale — patch immediately.
Authorized use only. Run only against systems you own or have explicit written permission to test. Using exploit code against systems you do not own is illegal in most jurisdictions and violates Yazoul's terms of use.
| Module | Source |
|---|---|
exploit/multi/http/struts_dmi_exec | View source |
1 Metasploit module indexed for this CVE. Source: rapid7/metasploit-framework.
Exploit-DB Entries
Curated public exploit code — authorized use only
The entries below are human-reviewed exploit code hosted on Exploit-DB by Offensive Security. Lower volume than random GitHub PoCs but higher signal: every entry is curated, many are tagged "verified" by the maintainers. Treat as production-ready exploit code.
Authorized use only. Run only against systems you own or have explicit written permission to test. Using exploit code against systems you do not own is illegal in most jurisdictions and violates Yazoul's terms of use.
| EDB-ID | Title | Status |
|---|---|---|
| EDB-39756 | Apache Struts - Dynamic Method Invocation Remote Code Execution (Metasploit) | verified |
1 Exploit-DB entry indexed for this CVE. Source: Exploit-DB.
Nuclei Detection Templates
Detection template available — your exposure is being scanned
The templates below are YAML signatures for the Nuclei scanner from ProjectDiscovery. They are not exploit code — they are detection rules that confirm whether a target is vulnerable. The presence of a Nuclei template means every bug bounty hunter, AppSec team, red team, and reconnaissance pipeline on the public internet is actively probing for this CVE.
Assume your exposed instances have already been touched. Patch immediately even if no exploitation is observed yet — fingerprinting precedes exploitation by days at most.
| Template | Source |
|---|---|
CVE-2016-3081.yaml | View YAML |
1 Nuclei template indexed for this CVE. Source: projectdiscovery/nuclei-templates.
Related Advisories
OS Command Injection Remote Code Execution Vulnerability in API in Progress ADC Products allows an un-authenticated attacker to execute arbitrary commands on the LoadMaster appliance by exploiting uns...
PraisonAI is a multi-agent teams system. Prior to version 4.6.9, the fix for PraisonAI's MCP command handling does not add a command allowlist or argument validation to parse_mcp_command(), allowing a...
electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to version 3.3.8, a command injection vulnerability exists in github.com/elcterm/electerm/npm/install.js...
electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to version 3.3.8, a command injection vulnerability exists in github.com/elcterm/electerm/npm/install.js...