/

CVE-2026-26278

Severity:

HIGH RISK

(7.5)

XML Entity Expansion / Denial of Service in fast-xml-parser

CVE-2026-26278

Modified

Vulnerability type

Category:

XML Entity Expansion / Denial of Service

CWE:

CWE-776

Impact:

Denial of Service via resource exhaustion

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

fast-xml-parser versions 4.1.3 through 5.3.5 are vulnerable to excessive XML entity expansion, allowing a tiny XML payload to trigger disproportionate processing.

An attacker can send crafted XML that causes the parser to spend seconds or minutes expanding entities, potentially freezing applications that rely on this library for XML processing.

Affected context

This vulnerability affects applications that use fast-xml-parser (4.1.3–5.3.5) to process XML input where DOCTYPE declarations and entity expansion are allowed.

It becomes relevant when XML content can be influenced by external or semi-trusted sources and is parsed synchronously within request/response paths or other latency-sensitive flows.

Systems that parse large volumes of external XML, or that run with limited CPU resources and blocking event loops (such as Node.js services), are particularly exposed to application-level stalls.

Exploit preconditions

  • Attack surface: Any API endpoint, service, or component that parses attacker-controlled or untrusted XML using fast-xml-parser with entity processing enabled.
  • Required access: Ability to submit or relay XML content to the vulnerable parser (e.g., HTTP POST body, message queue payload, file upload, or integration webhook).
  • Trigger point: Parsing of XML documents containing deeply nested or exponentially defined entities (e.g., crafted DOCTYPE sections) that the library expands.
  • Why exploitation is possible: The parser performs unbounded entity expansion without enforcing limits on depth, count, or cumulative size, allowing a very small input to consume disproportionate CPU time.

Why this happens

The underlying issue aligns with CWE-776: Improper Restriction of Recursive Entity Expansion in DTDs.

fast-xml-parser versions 4.1.3–5.3.5 expand XML entities defined in DTDs without robust limits on recursion depth or total expansions.

This design trusts the structure of the XML input and assumes entity expansion will remain reasonable, but crafted inputs can define entities that reference each other in ways that cause exponential growth in the expansion process.

Because the library does this work synchronously and without safeguards, it enables attackers to turn small XML payloads into heavy CPU workloads that stall or block the hosting application.

Potential impact

  • Application-level denial of service due to CPU exhaustion during XML parsing.
  • Increased request latency, timeouts, or thread/event-loop starvation for other users.
  • Service instability under load, including cascading failures across dependent services.
  • Potential exhaustion of server resources that may trigger watchdog restarts or scaling anomalies in containerized environments.

General mitigation guidance

Effective mitigation focuses on restricting XML features and bounding parser behavior so that untrusted input cannot cause unbounded work:

  • Disable or avoid processing of XML DTDs and entities when they are not strictly required; in fast-xml-parser, use configuration options that prevent entity expansion (e.g., disabling DOCTYPE processing).
  • Apply strict limits on XML input size and structural complexity (e.g., maximum depth, maximum number of nodes, or maximum entity count) before or during parsing.
  • Treat all externally influenced XML as untrusted data, and minimize reliance on complex XML features like entities, parameter entities, and external subsets.
  • Isolate heavy or potentially untrusted XML parsing from latency-sensitive request paths, for example by offloading to worker processes or services that can be rate-limited and monitored.
  • Apply general resource limiting and rate-limiting controls at the application and infrastructure layers to prevent a small set of hostile requests from monopolizing CPU time.

How teams detect issues like this

Detection typically combines code-level inspection with behavioral monitoring:

  • Static analysis & code review:
  • Look for use of fast-xml-parser (versions in the affected range) with configuration that allows DOCTYPE and entity processing.
  • Flag XML parsing code paths that handle untrusted input without explicit limits on size, structure, or features.
  • Review for synchronous parsing of client-controlled XML in hot paths (e.g., request handlers) without timeouts or isolation.
  • Dynamic & operational monitoring:
  • Track CPU spikes, long-running request handlers, and timeouts correlated with XML-heavy endpoints or workloads.
  • Log and inspect unusually small XML requests that lead to large processing times or repeat failures.
  • Policy enforcement:
  • Enforce secure XML parsing policies via code quality gates or automated review tools, requiring entity expansion and DTD support to be explicitly justified and guarded.
  • Maintain dependency policies that flag vulnerable XML-related libraries and configurations in CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/NaturalIntelligence/fast-xml-parser/commit/910dae5be2de2955e968558fadf6e8f74f117a77
github.comgithub.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.3.6
github.comgithub.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-jmr7-xgp7-cmfj
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40984
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41941
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41944
access.redhat.comaccess.redhat.com/errata/RHSA-2026:51349
access.redhat.comaccess.redhat.com/errata/RHSA-2026:6174
access.redhat.comaccess.redhat.com/errata/RHSA-2026:6802
access.redhat.comaccess.redhat.com/errata/RHSA-2026:7110
access.redhat.comaccess.redhat.com/errata/RHSA-2026:7128
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-26278
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2441120
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-26278.json

Frequently asked

questions

Yes, if an attacker can cause the application to parse XML they control or influence, they can remotely trigger excessive entity expansion and degrade service availability.

The attacker only needs the ability to submit XML content to a code path that uses fast-xml-parser with entity expansion enabled—typically via a public or internal API, integration endpoint, or message channel that accepts XML.

The most robust pattern is to disable XML DTD/entity processing for untrusted input and enforce strict limits on XML size and complexity. Where entities are necessary, they should be tightly constrained and combined with timeouts and resource limits around parsing.

Standardize on safe XML parsing configurations (e.g., no DTDs or entities for external input), perform dependency and configuration reviews for XML libraries, and codify these rules into automated checks so that new services cannot introduce unbounded entity expansion risks.

Find out what's already
exploitable in your codebase.