# CVE-2022-4245: Codehaus-plexus: xml external entity (xxe) injection

> An attacker can inject XML via unsanitized comments in Plexus XML utilities, potentially reading sensitive data or causing denial of service.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Sep 2023
- **Updated:** 3 Aug 2024
- **Also known as:** CLSA-2026-1791965617, CLSA-2026-1791965620, CLSA-2026-1791965626, CLSA-2026-1791965636, CLSA-2026-1791965637, CLSA-2026-1793136969, CLSA-2026-1793136993, CLSA-2026-1793137156, CLSA-2026-1793137245, DEBIAN-CVE-2022-4245, GHSA-jcwr-x25h-x5fh, UBUNTU-CVE-2022-4245

## What is CVE-2022-4245?

CVE-2022-4245 is a medium-severity vulnerability in Red Hat A-MQ Clients 2, published on 25 Sep 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

A flaw was found in codehaus-plexus. The org.codehaus.plexus.util.xml.XmlWriterUtil#writeComment fails to sanitize comments for a --> sequence. This issue means that text contained in the command string could be interpreted as XML and allow for XML injection.

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

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

2 open source packages ship an affected version, including org.codehaus.plexus:plexus-utils. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.codehaus.plexus:plexus-utils` | Maven | All versions | 3.0.24 |
| `org.codehaus.plexus:plexus-utils` | Maven | All versions | 3.0.24 |

Products: Codehaus-Plexus Plexus-Utils, Redhat Integration Camel K.

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

Upgrade org.codehaus.plexus:plexus-utils to 3.0.24 or later.

## Is CVE-2022-4245 being exploited?

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

## Other vulnerabilities in Red Hat A-MQ Clients 2

- [CVE-2017-1000487](https://insights.sbomify.com/CVE-2017-1000487/): OS Command Injection in Plexus-utils (critical 9.8)
- [CVE-2025-67030](https://insights.sbomify.com/CVE-2025-67030/): Plexus-Utils has a Directory Traversal vulnerability in its extractFile method (high 8.8)
- [CVE-2022-4244](https://insights.sbomify.com/CVE-2022-4244/): Codehaus-plexus: directory traversal (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-4245 is a medium-severity vulnerability in Red Hat A-MQ Clients 2, published on 25 Sep 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-4245 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.codehaus.plexus:plexus-utils (Maven): affected all versions; fixed in 3.0.24
- org.codehaus.plexus:plexus-utils (Maven): affected all versions; fixed in 3.0.24

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

## Sources

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

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