CVE-2012-0392: Struts2 core Remote Code Execution Vulnerability
MODERATECVE-2012-0392 is a MODERATE remote code execution vulnerability (General Security Weakness) affecting Struts2 core libraries in the Maven ecosystem. The issue involves apache struts's cookieinterceptor component does not use the parameter-name whitelist. Remediation is available by upgrading affected packages to version 2.2.3.1.
CVE-2012-0392 at a Glance
How to Fix CVE-2012-0392
To remediate this vulnerability, upgrade all affected Struts2 core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts.xwork</groupId>
<artifactId>xwork-core</artifactId>
<version>2.2.3.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.struts
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2012-0392, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.struts
Analyze the terminal output to locate any version of Struts2 core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.3.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.struts command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In Struts2 core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2012-0392 Affected Struts2 core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.struts:struts2-core
|
Maven |
< 2.2.3.1
|
2.2.3.1
|
|
org.apache.struts.xwork:xwork-core
|
Maven |
< 2.2.3.1
|
2.2.3.1
|
References
Frequently Asked Questions
What is CVE-2012-0392?
Which Struts2 core versions are affected?
What version fixes CVE-2012-0392?
Is struts2-core affected?
Is xwork-core affected?
What CWE is associated with CVE-2012-0392?
How can I check Maven dependencies for CVE-2012-0392?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2ppp-xj34-vvf7",
"modified" : "2023-12-27T20:13:27Z",
"published" : "2022-05-04T00:29:43Z",
"aliases" : [ "CVE-2012-0392" ],
"summary" : "Apache Struts's CookieInterceptor component does not use the parameter-name whitelist",
"details" : "The CookieInterceptor component in Apache Struts before 2.3.1.1 does not use the parameter-name whitelist, which allows remote attackers to execute arbitrary commands via a crafted HTTP Cookie header that triggers Java code execution through a static method.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.struts:struts2-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.3.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.struts.xwork:xwork-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-0392"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/struts/commit/25e50069d60434a30395e3a98357ffba2bed427e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/struts"
}, {
"type" : "WEB",
"url" : "https://lists.immunityinc.com/pipermail/dailydave/2012-January/000011.html"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20120612142634/https://sec-consult.com/files/20120104-0_Apache_Struts2_Multiple_Critical_Vulnerabilities.txt"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140723153720/http://secunia.com/advisories/47393"
}, {
"type" : "WEB",
"url" : "http://archives.neohapsis.com/archives/bugtraq/2012-01/0031.html"
}, {
"type" : "WEB",
"url" : "http://struts.apache.org/2.x/docs/s2-008.html"
}, {
"type" : "WEB",
"url" : "http://struts.apache.org/2.x/docs/version-notes-2311.html"
}, {
"type" : "WEB",
"url" : "http://www.exploit-db.com/exploits/18329"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-27T20:13:27Z",
"nvd_published_at" : "2012-01-08T15:55:00Z"
}
}