# CVE-2022-37865: Apache Ivy allows creating/overwriting any file on the system

> Attackers can overwrite arbitrary files on the system via malicious archives in Apache Ivy when using optional zip packaging features.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/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:** 7 Nov 2022
- **Updated:** 2 May 2025
- **Also known as:** GHSA-94rr-4jr5-9h2p

## What is CVE-2022-37865?

CVE-2022-37865 is a critical path traversal vulnerability in Apache Ivy, published on 7 Nov 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

With Apache Ivy 2.4.0 an optional packaging attribute has been introduced that allows artifacts to be unpacked on the fly if they used pack200 or zip packaging. For artifacts using the "zip", "jar" or "war" packaging Ivy prior to 2.5.1 doesn't verify the target path when extracting the archive. An archive containing absolute paths or paths that try to traverse "upwards" using ".." sequences can then write files to any location on the local fie system that the user executing Ivy has write access to. Ivy users of version 2.4.0 to 2.5.0 should upgrade to Ivy 2.5.1.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2022-37865?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.ivy:ivy` | Maven | From 2.4.0 | 2.5.1 |
| `org.apache.ivy:ivy` | Maven | From 2.4.0 | 2.5.1 |

Products: Apache Ivy.

## How do I fix CVE-2022-37865?

Upgrade org.apache.ivy:ivy to 2.5.1 or later.

## Is CVE-2022-37865 being exploited?

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

## Other vulnerabilities in Apache Ivy

- [CVE-2022-46751](https://insights.sbomify.com/CVE-2022-46751/): Apache Ivy: XML External Entity vulnerability in Apache Ivy (high 8.2)
- [CVE-2022-37866](https://insights.sbomify.com/CVE-2022-37866/): Apache Ivy allows path traversal in the presence of a malicious repository (high 7.5)
- [CVE-2026-26032](https://insights.sbomify.com/CVE-2026-26032/): Apache Ivy: PackagerResolver path traversal vulnerability (medium 5.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-37865 and fix it if it is affected.

What it is: CVE-2022-37865 is a critical path traversal vulnerability in Apache Ivy, published on 7 Nov 2022. 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-2022-37865 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.ivy:ivy (Maven): affected from 2.4.0; fixed in 2.5.1
- org.apache.ivy:ivy (Maven): affected from 2.4.0; fixed in 2.5.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-2022-37865/ (Markdown: https://insights.sbomify.com/CVE-2022-37865/index.md)
```

## Sources

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

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