# CVE-2022-46751: Apache Ivy: XML External Entity vulnerability in Apache Ivy

> An attacker can exploit XML External Entity vulnerabilities in Apache Ivy to exfiltrate data or disrupt execution by parsing malicious XML files.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Aug 2023
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-2jc4-r94c-rp7h, MINI-c3pw-49hq-53gg, SUSE-SU-2023:4367-1, openSUSE-SU-2024:13148-1

## What is CVE-2022-46751?

CVE-2022-46751 is a high-severity vulnerability in Apache Ivy, published on 21 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Improper Restriction of XML External Entity Reference, XML Injection (aka Blind XPath Injection) vulnerability in Apache Software Foundation Apache Ivy.This issue affects any version of Apache Ivy prior to 2.5.2.

When Apache Ivy prior to 2.5.2 parses XML files - either its own configuration, Ivy files or Apache Maven POMs - it will allow downloading external document type definitions and expand any entity references contained therein when used.

This can be used to exfiltrate data, access resources only the machine running Ivy has access to or disturb the execution of Ivy in different ways.

Starting with Ivy 2.5.2 DTD processing is disabled by default except when parsing Maven POMs where the default is to allow DTD processing but only to include a DTD snippet shipping with Ivy that is needed to deal with existing Maven POMs that are not valid XML files but are nevertheless accepted by Maven. Access can be be made more lenient via newly introduced system properties where needed.

Users of Ivy prior to version 2.5.2 can use Java system properties to restrict processing of external DTDs, see the section about "JAXP Properties for External Access restrictions" inside Oracle's "Java API for XML Processing (JAXP) Security Guide".

Weakness: CWE-91 (XML Injection), CWE-611 (Improper Restriction of XML External Entity Reference)

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

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 | All versions | 2.5.2 |
| `org.apache.ivy:ivy` | Maven | All versions | 2.5.2 |
| `apache-ivy` | SUSE:Enterprise Storage 7.1 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | openSUSE:Leap 15.4 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | openSUSE:Leap 15.5 | All versions | 2.5.2-150200.3.9.1 |
| `apache-ivy` | openSUSE:Tumbleweed | All versions | 2.5.2-1.1 |

Products: Apache Ivy.

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

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

## Is CVE-2022-46751 being exploited?

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

## Other vulnerabilities in Apache Ivy

- [CVE-2022-37865](https://insights.sbomify.com/CVE-2022-37865/): Apache Ivy allows creating/overwriting any file on the system (critical 9.1)
- [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-46751 and fix it if it is affected.

What it is: CVE-2022-46751 is a high-severity vulnerability in Apache Ivy, published on 21 Aug 2023. 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-46751 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.ivy:ivy (Maven): affected all versions; fixed in 2.5.2
- org.apache.ivy:ivy (Maven): affected all versions; fixed in 2.5.2

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

## Sources

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

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