CVE-2012-2098: Commons compress Remote Code Execution Vulnerability
MODERATECVE-2012-2098 is a MODERATE remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Commons compress libraries in the Maven ecosystem. The issue involves uncontrolled resource consumption in apache commons compress. Remediation is available by upgrading affected packages to version 1.4.1.
CVE-2012-2098 at a Glance
How to Fix CVE-2012-2098
To remediate this vulnerability, upgrade all affected Commons compress 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.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.4.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.commons
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2012-2098, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.commons
Analyze the terminal output to locate any version of Commons compress in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.commons 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Commons compress, 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-2098 Affected Commons compress Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.commons:commons-compress
|
Maven |
< 1.4.1
|
1.4.1
|
References
Frequently Asked Questions
What is CVE-2012-2098?
Which Commons compress versions are affected?
What version fixes CVE-2012-2098?
Is commons-compress affected?
What CWE is associated with CVE-2012-2098?
How can I check Maven dependencies for CVE-2012-2098?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6fxm-66hq-fc96",
"modified" : "2024-02-22T15:15:53Z",
"published" : "2022-05-13T01:07:05Z",
"aliases" : [ "CVE-2012-2098" ],
"summary" : "Uncontrolled Resource Consumption in Apache Commons Compress",
"details" : "Algorithmic complexity vulnerability in the sorting algorithms in bzip2 compressing stream (BZip2CompressorOutputStream) in Apache Commons Compress before 1.4.1 allows remote attackers to cause a denial of service (CPU consumption) via a file with many repeating inputs.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.commons:commons-compress"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-2098"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/020c03d8ef579e80511023fb46ece30e9c3dd27d"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/0600296ab8f8a0bbdfedd483f51b38005eb8e34e"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/1ce57d976c4f25fe99edcadf079840c278f3cb84"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/2ab2fcb356753927afaa731b9d2dcc47d3083408"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/654222e628097763ee6ca561ae77be5c06666173"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/6ced422bf5eca3aac05396367bafb33ec21bf74e"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/6e95697e783767f3549f00d7d2e1b002eac4a3d4"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/8f702469cbf4c451b6dea349290bc4af0f6f76c7"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/b06f7b41c936ef1a79589d16ea5c1d8b93f71f66"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/cca0e6e5341aacddefd4c4d36cef7cbdbc2a8777"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/ea31005111f0abede7e43e4ba0012e62e0808b22"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/commons-compress/commit/fdd7459bc5470e90024dbe762249166481cce769"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140724002926/http://secunia.com/advisories/49286"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140724023114/http://secunia.com/advisories/49255"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200517014414/http://www.securitytracker.com/id?1027096"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujan2021.html"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20130525085523/http://www.securityfocus.com/bid/53676"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r204ba2a9ea750f38d789d2bb429cc0925ad6133deea7cbc3001d96b5@<solr-user.lucene.apache.org>"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/commons-compress"
}, {
"type" : "WEB",
"url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/75857"
}, {
"type" : "WEB",
"url" : "http://ant.apache.org/security.html"
}, {
"type" : "WEB",
"url" : "http://archives.neohapsis.com/archives/bugtraq/2012-05/0130.html"
}, {
"type" : "WEB",
"url" : "http://commons.apache.org/compress/security.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081697.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081746.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2013-May/105049.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2013-May/105060.html"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.org/files/113014/Apache-Commons-Compress-Apache-Ant-Denial-Of-Service.html"
}, {
"type" : "WEB",
"url" : "http://www-01.ibm.com/support/docview.wss?uid=swg21644047"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2023/09/13/3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-13T21:10:51Z",
"nvd_published_at" : "2012-06-29T19:55:00Z"
}
}