CVE-2012-0391 is an improper input validation vulnerability in Apache Struts 2. CISA added it to the Known Exploited Vulnerabilities catalogue on 21 January 2022, which means attackers have used it in real attacks. The ExceptionDelegator component in Apache Struts 2 before 2.2.3.1 contains an improper input validation vulnerability that allows for remote code execution.
How CVE-2012-0391 Works in Apache Struts 2
CVE-2012-0391 is an improper input validation flaw in Apache Struts 2’s ExceptionDelegator component, which means untrusted data can reach dangerous logic paths instead of being strictly checked and constrained. In a web framework, that kind of weakness is especially serious because it can turn a routine request into server-side code execution.
The core issue is not simply that input is accepted, but that the framework fails to validate it well enough before using it in a way that affects control flow or execution behaviour. That makes the vulnerability class dangerous in any application that exposes Struts-based request handling to attackers.
Why Improper Input Validation Becomes Remote Code Execution
Input validation bugs are often underestimated because they can look like ordinary parsing problems. In practice, they can let an attacker supply data that changes how the application interprets a request, reaches privileged functionality, or invokes unsafe behaviour. In Struts-style applications, that can create a path from a web request to server-side command execution.
This is why improper input validation is a root-cause weakness rather than a cosmetic defect. The weakness can sit upstream of authorization, business logic, and error handling, so the damage is often broader than the visible component itself. For secure coding context, see the Secure Coding Guide and the CWE Top 25 Guide, which both treat input validation as a foundational control problem.
In vulnerability management terms, a flaw like this should be treated as internet-relevant until proven otherwise. The presence of real-world exploitation, reflected by its KEV listing, makes exposure review and prioritisation more urgent than for a theoretical weakness. The Vulnerability Management Guide is useful for framing that prioritisation around asset scope, KEV status and remediation verification.
How Organisations Check Exposure and Reduce Blast Radius
Exposure review starts with finding every application, service and deployment that includes the vulnerable Struts 2 line or a packaged product that embeds it. Asset inventory matters because “we do not use Struts” is often false once shared libraries, legacy apps and third-party platforms are included. Public-facing systems deserve the first pass because they are the most likely target for opportunistic exploitation.
When patching cannot happen immediately, compensating controls should focus on reducing reachability and limiting what a compromised process can touch. That usually means tightening network exposure, restricting administrative interfaces, hardening the server runtime, and watching for unusually risky request patterns. A secure coding and build discipline helps too, because validation defects are often discovered late and then persist across multiple releases.
For authoritative version and record details, use the CVE Program for the identifier record and the NIST National Vulnerability Database for structured vulnerability metadata. Those sources are the right place to confirm product naming and record context rather than relying on secondary summaries.
Detection, Post-Exploitation Review, and Identity Impact
Because this vulnerability can lead to remote code execution, detection should not stop at the patch event. Teams should review logs, process creation evidence, web server telemetry, and any signs that the application runtime executed unexpected commands or loaded unfamiliar modules. If the vulnerable application handled secrets, session material, or service credentials, assume those may have been exposed or abused during compromise.
The identity impact can be material even when the original flaw is not an identity problem. An attacker who gains code execution may steal API keys, session tokens, configuration secrets, database credentials, or deployment credentials from the host, then use them for lateral movement or persistence. That is why compromise review should include credential rotation, session invalidation, and a check for secondary access paths created after the initial exploit.
Where exploitation is suspected, compare what the application was able to read or execute before and after the patch, then confirm that no attacker-controlled persistence remains. The practical question is not only whether the vulnerable code is gone, but whether the host and adjacent access material are still trustworthy.
Risk and Threat Considerations
Remote code execution in a widely deployed web framework creates a high-consequence exposure because it can convert a single HTTP request into full application compromise. That makes this vulnerability attractive to attackers who want fast initial access, webshell-style persistence, or a foothold for credential theft and lateral movement.
Failure mechanism: The application trusts input that should have been rejected or constrained, allowing attacker-controlled data to influence server-side behaviour in a way that reaches code execution.
Impact: Attackers can run commands, plant persistence, steal secrets, pivot to adjacent systems, and use the compromised application as a launch point for broader intrusion activity.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SI-10 — Information Input Validation | CVE-2012-0391 is an input-validation flaw in a web framework |
| SI-2 — Flaw Remediation | This KEV-listed CVE requires timely remediation and verification | |
| RA-5 — Vulnerability Monitoring and Scanning | Exposure assessment depends on finding affected assets and deployed versions | |
| Recommendation — Apply SI-10 to validate and constrain untrusted request data before it reaches execution paths. Track and remediate the vulnerable Struts component, then verify the fix in affected systems. Continuously scan assets to identify systems that still include the vulnerable framework. | ||
| CIS Controls v8 | CIS-7 — Continuous Vulnerability Management | A KEV-listed exploited CVE fits continuous vulnerability prioritisation and remediation |
| CIS-18 — Application Software Security | The flaw is an application-layer validation weakness in a web framework | |
| Recommendation — Prioritise the affected Struts deployment for rapid remediation and post-fix verification. Review application controls so untrusted input is validated before it can influence execution. | ||
Practitioner Guidance
Why practitioners should care: Treat this as a vulnerable-application issue with identity fallout, not just a framework bug. Once code execution is possible, the security question expands to what secrets, sessions and downstream systems the application can reach.
What to watch for: Watch for unusual request bodies, unexpected process launches from the web tier, abnormal outbound connections, and signs that runtime secrets or deployment credentials were accessed after exploitation. If the application has been internet-facing, assume the review should include compromise hunting, not only patch verification.
Practitioner takeaway: Patch first, but validate the host and its access material as though the application may already have been used as an attacker foothold.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org