CVE-2026-24400: Assertj core AssertJ Has XML External Entity Vulnerability
HIGHCVE-2026-24400 is a HIGH assertj has xml external entity vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Assertj core libraries in the Maven ecosystem. The issue involves assertj has xml external entity (xxe) vulnerability when parsing untrusted xml via isxmlequalto assertion. Remediation is available by upgrading affected packages to version 3.27.7.
CVE-2026-24400 at a Glance
How to Fix CVE-2026-24400
To remediate this vulnerability, upgrade all affected Assertj core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.assertj
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-24400, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.assertj
Analyze the terminal output to locate any version of Assertj core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.27.7), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.assertj command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Assertj core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-24400 Affected Assertj core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.assertj:assertj-core
|
Maven |
≥ 1.4.0
< 3.27.7
|
3.27.7
|
References
Frequently Asked Questions
What is CVE-2026-24400?
Which Assertj core versions are affected?
What version fixes CVE-2026-24400?
Is assertj-core affected?
What CWE is associated with CVE-2026-24400?
How can I check Maven dependencies for CVE-2026-24400?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rqfh-9r24-8c9r",
"modified" : "2026-01-29T03:24:21Z",
"published" : "2026-01-26T21:31:41Z",
"aliases" : [ "CVE-2026-24400" ],
"summary" : "AssertJ has XML External Entity (XXE) vulnerability when parsing untrusted XML via isXmlEqualTo assertion",
"details" : "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.\n\nAn application is vulnerable only when it uses untrusted XML input with one of the following methods:\n\n- `isXmlEqualTo(CharSequence)` from `org.assertj.core.api.AbstractCharSequenceAssert`\n- `xmlPrettyFormat(String)` from `org.assertj.core.util.xml.XmlStringPrettyFormatter`\n\n### Impact\n\nIf untrusted XML input is processed by the methods mentioned above (e.g., in test environments handling external fixture files), an attacker could:\n\n- **Read arbitrary local files** via `file://` URIs (e.g., `/etc/passwd`, application configuration files)\n- **Perform Server-Side Request Forgery (SSRF)** via HTTP/HTTPS URIs\n- **Cause Denial of Service** via \"Billion Laughs\" entity expansion attacks\n\n### Mitigation\n\n`isXmlEqualTo(CharSequence)` has been deprecated in favor of [XMLUnit](https://www.xmlunit.org/) in version 3.18.0 and will be removed in version 4.0. Users of affected versions should, in order of preference:\n\n1. Replace `isXmlEqualTo(CharSequence)` with XMLUnit, or\n2. Upgrade to version 3.27.7, or\n3. Avoid using `isXmlEqualTo(CharSequence)` or `XmlStringPrettyFormatter` with untrusted input.\n\n`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.\n\n### References\n\n- [CWE-611: Improper Restriction of XML External Entity Reference](https://cwe.mitre.org/data/definitions/611.html)\n- [OWASP XXE Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.assertj:assertj-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.4.0"
}, {
"fixed" : "3.27.7"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.27.6"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/assertj/assertj/security/advisories/GHSA-rqfh-9r24-8c9r"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-24400"
}, {
"type" : "WEB",
"url" : "https://github.com/assertj/assertj/commit/85ca7eb6609bb179c043b85ae7d290523b1ba79a"
}, {
"type" : "WEB",
"url" : "https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/assertj/assertj"
}, {
"type" : "WEB",
"url" : "https://github.com/assertj/assertj/releases/tag/assertj-build-3.27.7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-26T21:31:41Z",
"nvd_published_at" : "2026-01-26T23:16:08Z"
}
}