# CVE-2012-2098: Uncontrolled Resource Consumption in Apache Commons Compress

> Remote attackers can cause denial of service via CPU exhaustion by submitting crafted files to applications using Apache Commons Compress.

- **Severity:** Medium 5.0 (`AV:N/AC:L/Au:N/C:N/I:N/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Jun 2012
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2012-2098, GHSA-6fxm-66hq-fc96, MGASA-2014-0056

## What is CVE-2012-2098?

CVE-2012-2098 is a medium-severity denial of service vulnerability in n/a, published on 29 Jun 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-310

## Which versions are affected by CVE-2012-2098?

2 open source packages ship an affected version, including org.apache.commons:commons-compress. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.commons:commons-compress` | Maven | All versions | 1.4.1 |
| `org.apache.commons:commons-compress` | Maven | All versions | 1.4.1 |

Products: Apache Commons Compress.

## How do I fix CVE-2012-2098?

Upgrade org.apache.commons:commons-compress to 1.4.1 or later.

## Is CVE-2012-2098 being exploited?

There is no known exploitation of CVE-2012-2098 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2024-25710](https://insights.sbomify.com/CVE-2024-25710/): Apache Commons Compress: Denial of service caused by an infinite loop for a corrupted DUMP file (high 8.1)
- [CVE-2021-35515](https://insights.sbomify.com/CVE-2021-35515/): Apache Commons Compress 1.6 to 1.20 denial of service vulnerability (high 7.5)
- [CVE-2021-35516](https://insights.sbomify.com/CVE-2021-35516/): Apache Commons Compress 1.6 to 1.20 denial of service vulnerability (high 7.5)
- [CVE-2021-35517](https://insights.sbomify.com/CVE-2021-35517/): Apache Commons Compress 1.1 to 1.20 denial of service vulnerability (high 7.5)
- [CVE-2021-36090](https://insights.sbomify.com/CVE-2021-36090/): Apache Commons Compress 1.0 to 1.20 denial of service vulnerability (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2012-2098 and fix it if it is affected.

What it is: CVE-2012-2098 is a medium-severity denial of service vulnerability in n/a, published on 29 Jun 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2012-2098 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.commons:commons-compress (Maven): affected all versions; fixed in 1.4.1
- org.apache.commons:commons-compress (Maven): affected all versions; fixed in 1.4.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2012-2098/ (Markdown: https://insights.sbomify.com/CVE-2012-2098/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2012-2098
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2012-2098
- OSV: https://osv.dev/vulnerability/CVE-2012-2098

---
From sbomify Insights: https://insights.sbomify.com/CVE-2012-2098/
Summaries are generated and may contain mistakes; the official description above is the record.
