CVE-2012-2098: Commons compress Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-6fxm-66hq-fc96
CWE-400
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2012-2098
GHSA Identifier GHSA-6fxm-66hq-fc96
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Commons compress
Package Ecosystem Maven
Published Date
Last Updated

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.

org.apache.commons:commons-compress fixed: 1.4.1
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-compress</artifactId>
    <version>1.4.1</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.

CVE-2012-2098 Affected Commons compress Versions

1 component(s)
Fixed Versions:
1.4.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.commons:commons-compress
Maven
< 1.4.1
1.4.1

References

NVD — CVE-2012-2098 NVD
https://nvd.nist.gov/vuln/detail/CVE-2012-2098
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/020c03d8ef579e80511023fb46ece30e9c3dd27d
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/0600296ab8f8a0bbdfedd483f51b38005eb8e34e
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/1ce57d976c4f25fe99edcadf079840c278f3cb84
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/2ab2fcb356753927afaa731b9d2dcc47d3083408
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/654222e628097763ee6ca561ae77be5c06666173
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/6ced422bf5eca3aac05396367bafb33ec21bf74e
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/6e95697e783767f3549f00d7d2e1b002eac4a3d4
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/8f702469cbf4c451b6dea349290bc4af0f6f76c7
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/b06f7b41c936ef1a79589d16ea5c1d8b93f71f66
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/cca0e6e5341aacddefd4c4d36cef7cbdbc2a8777
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/ea31005111f0abede7e43e4ba0012e62e0808b22
Security Fix Commit FIX COMMIT
https://github.com/apache/commons-compress/commit/fdd7459bc5470e90024dbe762249166481cce769
web.archive.org/web/20140724002926/... WEB
https://web.archive.org/web/20140724002926/http://secunia.com/advisories/49286
web.archive.org/web/20140724023114/... WEB
https://web.archive.org/web/20140724023114/http://secunia.com/advisories/49255
Commons compress Security Information SECURITY
https://web.archive.org/web/20200517014414/http://www.securitytracker.com/id?1027096
Commons compress Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2021.html
Commons compress Security Information SECURITY
https://web.archive.org/web/20130525085523/http://www.securityfocus.com/bid/53676
https://lists.apache.org/thread.html/r204ba2a9ea750f38d789d2bb429cc0925ad6133deea7cbc3001d96b5@<solr-user.lucene.apache.org> WEB
https://lists.apache.org/thread.html/r204ba2a9ea750f38d789d2bb429cc0925ad6133deea7cbc3001d96b5@<solr-user.lucene.apache.org>
Commons compress Source Repository REPOSITORY
https://github.com/apache/commons-compress
exchange.xforce.ibmcloud.com/vulnerabilities/758... WEB
https://exchange.xforce.ibmcloud.com/vulnerabilities/75857
Commons compress Security Information SECURITY
http://ant.apache.org/security.html
archives.neohapsis.com/archives/bugtraq/20... WEB
http://archives.neohapsis.com/archives/bugtraq/2012-05/0130.html
Commons compress Security Information SECURITY
http://commons.apache.org/compress/security.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081697.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081746.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2013-May/105049.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2013-May/105060.html
Commons compress Security Information SECURITY
http://packetstormsecurity.org/files/113014/Apache-Commons-Compress-Apache-Ant-Denial-Of-Service.html
www-01.ibm.com/support/docview.wss WEB
http://www-01.ibm.com/support/docview.wss?uid=swg21644047
Commons compress Security Information SECURITY
http://www.openwall.com/lists/oss-security/2023/09/13/3

Frequently Asked Questions

What is CVE-2012-2098?
CVE-2012-2098 is a security vulnerability in Commons compress involving Uncontrolled Resource Consumption in Apache Commons Compress under CWE-400: Uncontrolled Resource Consumption.
Which Commons compress versions are affected?
Affected versions include releases prior to 1.4.1 across affected packages: org.apache.commons:commons-compress.
What version fixes CVE-2012-2098?
Upgrading to 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is commons-compress affected?
Yes, org.apache.commons:commons-compress is affected in releases prior to 1.4.1. Upgrade your dependency to 1.4.1 or later.
What CWE is associated with CVE-2012-2098?
CVE-2012-2098 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2012-2098?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.commons'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}