# CVE-2019-12402: Denial of Service in Apache Commons Compress

> An attacker can cause a denial of service via an infinite loop in Apache Commons Compress by providing specially crafted file names in an archive.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Aug 2019
- **Updated:** 4 Aug 2024
- **Also known as:** CLSA-2026-1784769508, DEBIAN-CVE-2019-12402, GHSA-53x6-4x5p-rrvv, MGASA-2020-0001, UBUNTU-CVE-2019-12402

## What is CVE-2019-12402?

CVE-2019-12402 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 29 Aug 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The file name encoding algorithm used internally in Apache Commons Compress 1.15 to 1.18 can get into an infinite loop when faced with specially crafted inputs. This can lead to a denial of service attack if an attacker can choose the file names inside of an archive created by Compress.

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

## Which versions are affected by CVE-2019-12402?

4 open source packages ship an affected version, including io.github.1tchy.java9modular.org.apache.commons:commons-compress and org.apache.commons:commons-compress. It affects 19 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.github.1tchy.java9modular.org.apache.commons:commons-compress` | Maven | All versions | None |
| `io.github.1tchy.java9modular.org.apache.commons:commons-compress` | Maven | All versions | None |
| `org.apache.commons:commons-compress` | Maven | From 1.15 | 1.19 |
| `org.apache.commons:commons-compress` | Maven | From 1.15 | 1.19 |

Products: Apache Commons Compress, Fedoraproject Fedora, Oracle Banking Payments, Oracle Banking Platform, Oracle Communications Element Manager, Oracle Communications Ip Service Activator, Oracle Communications Session Report Manager, Oracle Communications Session Route Manager, Oracle Customer Management and Segmentation Foundation, Oracle Essbase, Oracle Flexcube Investor Servicing, Oracle Flexcube Private Banking, Oracle Hyperion Infrastructure Technology, Oracle Jdeveloper, Oracle Peoplesoft Enterprise Pt Peopletools, Oracle Primavera Gateway, Oracle Retail Integration Bus, Oracle Retail Xstore Point of Service, Oracle Webcenter Portal.

## How do I fix CVE-2019-12402?

Upgrade to a fixed version.

## Is CVE-2019-12402 being exploited?

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

## Other vulnerabilities in Fedoraproject Fedora

- [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-2019-12402 and fix it if it is affected.

What it is: CVE-2019-12402 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 29 Aug 2019. 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-2019-12402 in the wild and no public exploit code.

Affected packages and fixed versions:
- io.github.1tchy.java9modular.org.apache.commons:commons-compress (Maven): affected all versions; no fix listed
- io.github.1tchy.java9modular.org.apache.commons:commons-compress (Maven): affected all versions; no fix listed
- org.apache.commons:commons-compress (Maven): affected from 1.15; fixed in 1.19
- org.apache.commons:commons-compress (Maven): affected from 1.15; fixed in 1.19

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-2019-12402/ (Markdown: https://insights.sbomify.com/CVE-2019-12402/index.md)
```

## Sources

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

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