# CVE-2024-31573: XMLUnit for Java has Insecure Defaults when Processing XSLT Stylesheets

> Attackers can execute arbitrary code via untrusted XSLT stylesheets in XMLUnit for Java due to enabled extension functions.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Oct 2025
- **Updated:** 17 Oct 2025
- **Also known as:** CLEANSTART-2026-UV31886, CLSA-2024-1727136010, CLSA-2025-1740614445, CLSA-2026-1793128026, GHSA-chfm-68vv-pvw5, OESA-2025-1966, OESA-2025-1967, OESA-2025-1968, OESA-2025-1969, OESA-2025-1970, RHLW-2026-bf51d193d76de6ef, RHLW-2026-de2bb03e40c2ec86, RHLW-2026-e5adae5b227184e1, RHLW-2026-ea9f6fe6976a39aa, ROOT-APP-MAVEN-CVE-2024-31573, UBUNTU-CVE-2024-31573

## What is CVE-2024-31573?

CVE-2024-31573 is a medium-severity code injection vulnerability in XMLUnit for Java, published on 17 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

XMLUnit for Java before 2.10.0, in the default configuration, might allow code execution via an untrusted stylesheet (used for an XSLT transformation), because XSLT extension functions are enabled.

Weakness: CWE-669 (Incorrect Resource Transfer Between Spheres)

## Which versions are affected by CVE-2024-31573?

2 open source packages ship an affected version, including org.xmlunit:xmlunit-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.xmlunit:xmlunit-core` | Maven | All versions | 2.10.0 |
| `org.xmlunit:xmlunit-core` | Maven | All versions | 2.10.0 |

## How do I fix CVE-2024-31573?

Upgrade org.xmlunit:xmlunit-core to 2.10.0 or later.

## Is CVE-2024-31573 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-31573 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-31573 and fix it if it is affected.

What it is: CVE-2024-31573 is a medium-severity code injection vulnerability in XMLUnit for Java, published on 17 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-31573 exists.

Affected packages and fixed versions:
- org.xmlunit:xmlunit-core (Maven): affected all versions; fixed in 2.10.0
- org.xmlunit:xmlunit-core (Maven): affected all versions; fixed in 2.10.0

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

## Sources

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

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