# CVE-2018-1324: Apache Commons Compress vulnerable to denial of service due to infinite loop

> Attackers can cause a denial of service via infinite loop in Apache Commons Compress by submitting crafted ZIP archives.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 16 Mar 2018
- **Updated:** 17 Sep 2024
- **Also known as:** CLSA-2026-1785909110, DEBIAN-CVE-2018-1324, GHSA-h436-432x-8fvx, UBUNTU-CVE-2018-1324

## What is CVE-2018-1324?

CVE-2018-1324 is a medium-severity denial of service vulnerability in Oracle Mysql Cluster, published on 16 Mar 2018. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

A specially crafted ZIP archive can be used to cause an infinite loop inside of Apache Commons Compress' extra field parser used by the ZipFile and ZipArchiveInputStream classes in versions 1.11 to 1.15. This can be used to mount a denial of service attack against services that use Compress' zip package.

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

## Which versions are affected by CVE-2018-1324?

6 open source packages ship an affected version, including com.liferay:com.liferay.portal.tools.bundle.support, io.takari:commons-compress and org.apache.commons:commons-compress. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `com.liferay:com.liferay.portal.tools.bundle.support` | Maven | From 3.2.7 | 3.7.4 |
| `com.liferay:com.liferay.portal.tools.bundle.support` | Maven | From 3.2.7 | 3.7.4 |
| `io.takari:commons-compress` | Maven | All versions | None |
| `io.takari:commons-compress` | Maven | All versions | None |
| `org.apache.commons:commons-compress` | Maven | From 1.11 | 1.16 |
| `org.apache.commons:commons-compress` | Maven | From 1.11 | 1.16 |

Products: Apache Commons Compress, Oracle Mysql Cluster, Oracle Weblogic Server.

## How do I fix CVE-2018-1324?

Upgrade com.liferay:com.liferay.portal.tools.bundle.support to 3.7.4 or later.

## Is CVE-2018-1324 being exploited?

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

Public exploit code:

- https://github.com/tafamace/CVE-2018-1324 (github_poc): https://github.com/tafamace/CVE-2018-1324

## Other vulnerabilities in Oracle Mysql Cluster

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

What it is: CVE-2018-1324 is a medium-severity denial of service vulnerability in Oracle Mysql Cluster, published on 16 Mar 2018. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2018-1324 in the wild and no public exploit code.

Affected packages and fixed versions:
- com.liferay:com.liferay.portal.tools.bundle.support (Maven): affected from 3.2.7; fixed in 3.7.4
- com.liferay:com.liferay.portal.tools.bundle.support (Maven): affected from 3.2.7; fixed in 3.7.4
- io.takari:commons-compress (Maven): affected all versions; no fix listed
- io.takari:commons-compress (Maven): affected all versions; no fix listed
- org.apache.commons:commons-compress (Maven): affected from 1.11; fixed in 1.16
- org.apache.commons:commons-compress (Maven): affected from 1.11; fixed in 1.16

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

## Sources

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

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