An XML External Entity (XXE) vulnerability exists in org.assertj.core.util.xml.XmlStringPrettyFormatter: the toXmlDocument(String) method initializes DocumentBuilderFactory with default settings, without disabling DTDs or external entities. This formatter is used by the isXmlEqualTo(CharSequence) assertion for CharSequence values.
An application is vulnerable only when it uses untrusted XML input with one of the following methods:
isXmlEqualTo(CharSequence) from org.assertj.core.api.AbstractCharSequenceAssertxmlPrettyFormat(String) from org.assertj.core.util.xml.XmlStringPrettyFormatterIf untrusted XML input is processed by the methods mentioned above (e.g., in test environments handling external fixture files), an attacker could:
file:// URIs (e.g., /etc/passwd, application configuration files)isXmlEqualTo(CharSequence) has been deprecated in favor of XMLUnit in version 3.18.0 and will be removed in version 4.0. Users of affected versions should, in order of preference:
isXmlEqualTo(CharSequence) with XMLUnit, orisXmlEqualTo(CharSequence) or XmlStringPrettyFormatter with untrusted input.XmlStringPrettyFormatter has historically been considered a utility for isXmlEqualTo(CharSequence) rather than a feature for AssertJ users, so it is deprecated in version 3.27.7 and removed in version 4.0, with no replacement.
3.27.7Exploitability
AV:LAC:LAT:NPR:LUI:NVulnerable System
VC:HVI:NVA:LSubsequent System
SC:HSI:NSA:N8.2/CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:L/SC:H/SI:N/SA:N