CVE-2013-2186: Commons fileupload Arbitrary File Write Vulnerability
HIGHCVE-2013-2186 is a HIGH arbitrary file write vulnerability (CWE-20: Improper Input Validation) affecting Commons fileupload libraries in the Maven ecosystem. The issue involves arbitrary file write in apache commons fileupload. Remediation is available by upgrading affected packages to version 1.3.1.
CVE-2013-2186 at a Glance
How to Fix CVE-2013-2186
To remediate this vulnerability, upgrade all affected Commons fileupload 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>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.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=commons-fileupload
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2013-2186, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=commons-fileupload
Analyze the terminal output to locate any version of Commons fileupload in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=commons-fileupload 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Commons fileupload, 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-2013-2186 Affected Commons fileupload Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
commons-fileupload:commons-fileupload
|
Maven |
< 1.3.1
|
1.3.1
|
References
Frequently Asked Questions
What is CVE-2013-2186?
Which Commons fileupload versions are affected?
What version fixes CVE-2013-2186?
Is commons-fileupload affected?
What CWE is associated with CVE-2013-2186?
How can I check Maven dependencies for CVE-2013-2186?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qx6h-9567-5fqw",
"modified" : "2024-03-05T17:59:41Z",
"published" : "2022-05-14T03:52:43Z",
"aliases" : [ "CVE-2013-2186" ],
"summary" : "Arbitrary file write in Apache Commons Fileupload",
"details" : "The DiskFileItem class in Apache Commons FileUpload, as used in Red Hat JBoss BRMS 5.3.1; JBoss Portal 4.3 CP07, 5.2.2, and 6.0.0; and Red Hat JBoss Web Server 1.0.2 allows remote attackers to write to arbitrary files via a NULL byte in a file name in a serialized instance.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "commons-fileupload:commons-fileupload"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-2186"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-fileupload/commit/163a6061fbc077d4b6e4787d26857c2baba495d1"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2016:0070"
}, {
"type" : "WEB",
"url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/88133"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/commons-fileupload"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-fileupload/blob/master/RELEASE-NOTES.txt"
}, {
"type" : "WEB",
"url" : "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2014-10-01"
}, {
"type" : "WEB",
"url" : "https://www.tenable.com/security/research/tra-2016-23"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-security-announce/2013-11/msg00008.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-updates/2013-10/msg00033.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-updates/2013-10/msg00050.html"
}, {
"type" : "WEB",
"url" : "http://rhn.redhat.com/errata/RHSA-2013-1448.html"
}, {
"type" : "WEB",
"url" : "http://ubuntu.com/usn/usn-2029-1"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2013/dsa-2827"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/63174"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-03T21:09:29Z",
"nvd_published_at" : "2013-10-28T21:55:00Z"
}
}