Lucene search

K
githubGitHub Advisory DatabaseGHSA-CHFM-68VV-PVW5
HistoryMay 01, 2024 - 4:40 p.m.

XMLUnit for Java has Insecure Defaults when Processing XSLT Stylesheets

2024-05-0116:40:01
GitHub Advisory Database
github.com
25
xmlunit
java
insecure defaults
xslt
stylesheets
patches
upgrade
workarounds
bug report
jaxp security guide
remote code execution

AI Score

8.1

Confidence

Low

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

Bug Report
JAXP Security Guide

Affected configurations

Vulners
Node
org.xmlunitxmlunit-coreRange<2.10.0
VendorProductVersionCPE
org.xmlunitxmlunit-core*cpe:2.3:a:org.xmlunit:xmlunit-core:*:*:*:*:*:*:*:*

AI Score

8.1

Confidence

Low

Related for GHSA-CHFM-68VV-PVW5