CVE-2012-0391 Apache Struts 2 Improper Input Validation
Remote attackers can execute arbitrary Java code via crafted parameters due to unsafe OGNL expression evaluation in exception handling.
- Exploited in the wild
- Since 21 Jan 2022
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2012-0391?
CVE-2012-0391 is a critical code injection vulnerability in Apache Struts, published on 8 Jan 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-94
Which versions are affected by CVE-2012-0391?
4 open source packages ship an affected version, including org.apache.struts.xwork:xwork-core and org.apache.struts:struts2-core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.apache.struts.xwork:xwork-core Maven | All versions | 2.2.3.1 |
org.apache.struts.xwork:xwork-core Maven | All versions | 2.2.3.1 |
org.apache.struts:struts2-core Maven | All versions | 2.2.3.1 |
org.apache.struts:struts2-core Maven | All versions | 2.2.3.1 |
Products include Apache Struts.
How do I fix CVE-2012-0391?
Upgrade org.apache.struts.xwork:xwork-core to 2.2.3.1 or later. US federal agencies must fix it by 21 Jul 2022.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2012-0391 being exploited?
Yes. Attackers have exploited CVE-2012-0391 in the wild since at least 21 Jan 2022.
Public exploit code: 1 Metasploit module and 2 Exploit-DB entries.
Other vulnerabilities in Apache Struts
Sources
Also known as GHSA-4wrr-9h5r-m92w.