CVE-2026-24400: Assertj core AssertJ Has XML External Entity Vulnerability

HIGH
Advisory Identifier: GHSA-rqfh-9r24-8c9r
CWE-611
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-24400
GHSA Identifier GHSA-rqfh-9r24-8c9r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Assertj core
Package Ecosystem Maven
Published Date
Last Updated

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.

org.assertj:assertj-core fixed: 3.27.7
<dependency>
    <groupId>org.assertj</groupId>
    <artifactId>assertj-core</artifactId>
    <version>3.27.7</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.AbstractCharSequenceAssert` - `xmlPrettyFormat(String)` from `org.assertj.core.util.xml.XmlStringPrettyFormatter` ### Impact If untrusted XML input is processed by the methods mentioned above (e.g., in test environments handling external fixture files), an attacker could: - **Read arbitrary local files** via `file://` URIs (e.g., `/etc/passwd`, application configuration files) - **Perform Server-Side Request Forgery (SSRF)** via HTTP/HTTPS URIs - **Cause Denial of Service** via "Billion Laughs" entity expansion attacks ### Mitigation `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: 1. Replace `isXmlEqualTo(CharSequence)` with XMLUnit, or 2. Upgrade to version 3.27.7, or 3. Avoid using `isXmlEqualTo(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. ### References - [CWE-611: Improper Restriction of XML External Entity Reference](https://cwe.mitre.org/data/definitions/611.html) - [OWASP XXE Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html)

CVE-2026-24400 Affected Assertj core Versions

1 component(s)
Fixed Versions:
3.27.7
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?
CVE-2026-24400 is a security vulnerability in Assertj core involving AssertJ has XML External Entity (XXE) vulnerability when parsing untrusted XML via isXmlEqualTo assertion under CWE-611: Improper Restriction of XML External Entity Reference.
Which Assertj core versions are affected?
Affected versions include releases prior to 3.27.7 across affected packages: org.assertj:assertj-core.
What version fixes CVE-2026-24400?
Upgrading to 3.27.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is assertj-core affected?
Yes, org.assertj:assertj-core is affected in releases prior to 3.27.7. Upgrade your dependency to 3.27.7 or later.
What CWE is associated with CVE-2026-24400?
CVE-2026-24400 is classified under CWE-611: Improper Restriction of XML External Entity Reference (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.).
How can I check Maven dependencies for CVE-2026-24400?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.assertj'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}