CVE-2016-3081: Struts2 core Remote Code Execution Vulnerability
HIGHCVE-2016-3081 is a HIGH (CVSS 8.1) remote code execution vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Struts2 core libraries in the Maven ecosystem. The issue involves apache struts rce vulnerability. Remediation is available by upgrading affected packages to version 2.3.20.3, 2.3.24.3, 2.3.28.1.
CVE-2016-3081 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2016-3081
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.3.20.3</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.3</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.28.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-2016-3081, 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.3.20.3), 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 CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. 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-2016-3081 Affected Struts2 core Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.struts:struts2-core
|
Maven |
≥ 2.3.19
< 2.3.20.3
|
2.3.20.3
|
|
org.apache.struts:struts2-core
|
Maven |
≥ 2.3.21
< 2.3.24.3
|
2.3.24.3
|
|
org.apache.struts:struts2-core
|
Maven |
≥ 2.3.25
< 2.3.28.1
|
2.3.28.1
|
References
Frequently Asked Questions
What is CVE-2016-3081?
Which Struts2 core versions are affected?
What version fixes CVE-2016-3081?
Is struts2-core affected?
What is the CVSS score of CVE-2016-3081?
What CWE is associated with CVE-2016-3081?
How can I check Maven dependencies for CVE-2016-3081?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8c6j-ffmf-q6vm",
"modified" : "2023-11-01T19:47:28Z",
"published" : "2022-05-14T00:54:14Z",
"aliases" : [ "CVE-2016-3081" ],
"summary" : "Apache Struts RCE Vulnerability",
"details" : "Apache 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, when Dynamic Method Invocation is enabled, allow remote attackers to execute arbitrary code via method: prefix, related to chained expressions.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.struts:struts2-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.19"
}, {
"fixed" : "2.3.20.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.3.20.2"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.struts:struts2-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.21"
}, {
"fixed" : "2.3.24.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.3.24.2"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.struts:struts2-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.25"
}, {
"fixed" : "2.3.28.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.3.28"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-3081"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/struts"
}, {
"type" : "WEB",
"url" : "https://struts.apache.org/docs/s2-032.html"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20210123152457/http://www.securityfocus.com/bid/91787"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20210225192113/http://www.securityfocus.com/bid/87327"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20210226011418/http://www.securitytracker.com/id/1035665"
}, {
"type" : "WEB",
"url" : "https://www.exploit-db.com/exploits/39756"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/136856/Apache-Struts-2.3.28-Dynamic-Method-Invocation-Remote-Code-Execution.html"
}, {
"type" : "WEB",
"url" : "http://www.huawei.com/en/psirt/security-advisories/huawei-sa-20160527-01-struts2-en"
}, {
"type" : "WEB",
"url" : "http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html"
}, {
"type" : "WEB",
"url" : "http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html"
}, {
"type" : "WEB",
"url" : "http://www.rapid7.com/db/modules/exploit/linux/http/struts_dmi_exec"
}, {
"type" : "WEB",
"url" : "http://www.rapid7.com/db/modules/exploit/multi/http/struts_dmi_exec"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-28T21:21:01Z",
"nvd_published_at" : "2016-04-26T14:59:00Z"
}
}