# CVE-2012-0391: Apache Struts Remote Java Code Execution

Source: https://junglewise.ai/threats/cve-2012-0391-apache-struts-2-improper-input-validation-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-05-04. Updated: 2026-05-11  
License: CC BY 4.0 with a link back

CVE-2012-0391 · Severity: critical · CVSS 9.8 · Exploited in the wild · Published 2022-05-04

The `ExceptionDelegator` component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during certain exception handling for mismatched data types of properties, which allows remote attackers to execute arbitrary Java code via a crafted parameter.

Technologies: [Apache Struts 2](https://junglewise.ai/threats/technologies/struts-2), [org.apache.struts:struts2-core (Maven)](https://junglewise.ai/threats/technologies/org-apache-struts-struts2-core), [org.apache.struts.xwork:xwork-core (Maven)](https://junglewise.ai/threats/technologies/org-apache-struts-xwork-xwork-core). Vendors: [Apache](https://junglewise.ai/threats/vendors/apache), [Maven](https://junglewise.ai/threats/vendors/maven).

## Quick answers

**Is CVE-2012-0391 exploited in the wild?** Yes. CVE-2012-0391 is known to be exploited in the wild, first recorded on 21 January 2022. Treat it as urgent.

**How severe is CVE-2012-0391?** Critical severity, with a CVSS score of 9.8, published 4 May 2022.

**Which products and versions are affected?** org.apache.struts:struts2-core (Maven) < 2.2.3.1, ECOSYSTEM:introduced=0,fixed=2.2.3.1; org.apache.struts.xwork:xwork-core (Maven) < 2.2.3.1, ECOSYSTEM:introduced=0,fixed=2.2.3.1.

**Is there a fix for CVE-2012-0391?** Yes. org.apache.struts:struts2-core (Maven): upgrade to 2.2.3.1 or later; org.apache.struts.xwork:xwork-core (Maven): upgrade to 2.2.3.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2012-0391?** Check whether you run Apache Struts 2, org.apache.struts:struts2-core (Maven) or org.apache.struts.xwork:xwork-core (Maven) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- org.apache.struts:struts2-core (Maven): upgrade to 2.2.3.1 or later

  ```sh
  # set org.apache.struts:struts2-core to 2.2.3.1 in your pom.xml or build.gradle
  ```

- org.apache.struts.xwork:xwork-core (Maven): upgrade to 2.2.3.1 or later

  ```sh
  # set org.apache.struts.xwork:xwork-core to 2.2.3.1 in your pom.xml or build.gradle
  ```


## Affected products

- Apache Struts 2
- org.apache.struts:struts2-core (Maven) < 2.2.3.1, ECOSYSTEM:introduced=0,fixed=2.2.3.1
- org.apache.struts.xwork:xwork-core (Maven) < 2.2.3.1, ECOSYSTEM:introduced=0,fixed=2.2.3.1

## Identifiers

- CVE-2012-0391
- GHSA-4wrr-9h5r-m92w

## References

- [https://api.github.com/users/sunSUNQ](https://api.github.com/users/sunSUNQ)
- [https://github.com/sunSUNQ](https://github.com/sunSUNQ)
- [https://api.github.com/users/sunSUNQ/gists%7B/gist_id%7D](https://api.github.com/users/sunSUNQ/gists%7B/gist_id%7D)
- [https://api.github.com/users/sunSUNQ/repos](https://api.github.com/users/sunSUNQ/repos)
- [https://avatars.githubusercontent.com/u/33311698?v=4](https://avatars.githubusercontent.com/u/33311698?v=4)
- [https://api.github.com/users/sunSUNQ/events%7B/privacy%7D](https://api.github.com/users/sunSUNQ/events%7B/privacy%7D)

## Related threats

- [Apache Struts XXE injection in XWork component](https://junglewise.ai/threats/cve-2025-68493-apache-struts-xxe-injection-in-xwork-component)
- [Apache Struts has a Denial of Service vulnerability](https://junglewise.ai/threats/cve-2025-66675-apache-struts-has-a-denial-of-service-vulnerability)
- [Apache Struts is Vulnerable to DoS via File Leak](https://junglewise.ai/threats/cve-2025-64775-apache-struts-is-vulnerable-to-dos-via-file-leak)
- [Apache Struts file upload logic is flawed](https://junglewise.ai/threats/cve-2024-53677-apache-struts-file-upload-logic-is-flawed)
- [Apache Struts vulnerable to path traversal](https://junglewise.ai/threats/cve-2023-50164-apache-struts-vulnerable-to-path-traversal)
