4.0medium
XMLUnit for Java has Insecure Defaults when Processing XSLT Stylesheets
- Severity
- 4.0medium CVSS:3.1 by mitre
- Exploit likelihood
- 0.32% (higher than 26% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-chfm-68vv-pvw5
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| XMLUnit XMLUnit for Java | from 2.0.0 before 2.10.0 | CVE List |
| org.xmlunit:xmlunit-core (Maven) | before 2.10.0 | GitHub Advisory Database |
All scores
| mitre | 4.0medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N |
| GitHub | low rating |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
When performing XSLT transformations XMLUnit for Java did not disable XSLT extension functions by default. Depending on the XSLT processor being used this could allow arbitrary code to be executed when XMLUnit is used to transform data with a stylesheet who's source can not be trusted. If the stylesheet can be provided externally this may even lead to a remote code execution.
Patches
Users are advised to upgrade to XMLUnit for Java 2.10.0 where the default has been changed by means of https://github.com/xmlunit/xmlunit/commit/b81d48b71dfd2868bdfc30a3e17ff973f32bc15b
Workarounds
XMLUnit's main use-case is performing tests on code that generates or processes XML. Most users will not use it to perform arbitrary XSLT transformations.
Users running XSLT transformations with untrusted stylesheets should explicitly use XMLUnit's APIs to pass in a pre-configured TraX TransformerFactory with extension functions disabled via features and attributes. The required setFactory or setTransformerFactory methods have been available since XMLUnit for Java 2.0.0.
References
NVD (es)
XMLUnit para Java anterior a 2.10.0, en la configuración predeterminada, podría permitir la ejecución de código a través de una hoja de estilo no confiable (utilizada para una transformación XSLT), porque las funciones de extensión XSLT están habilitadas.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-31573 changed 2025-10-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-chfm-68vv-pvw5 changed 2024-12-05 | CC-BY-4.0 |
| NVD | CVE-2024-31573 changed 2026-10-02 | Public domain |