/

CVE-2026-25128

Severity:

HIGH RISK

(7.5)

Input Validation Error in fast-xml-parser

CVE-2026-25128

Analyzed

Vulnerability type

Category:

Input Validation Error

CWE:

CWE-20, CWE-248

Impact:

Denial of Service via Application Crash

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.3.6 through 5.3.3 contain a flaw in numeric entity handling where out-of-range code points (such as � or �) trigger a RangeError that is not safely handled.

Applications that parse untrusted XML using these versions may crash on malformed input, enabling denial-of-service conditions through a single crafted XML document.

Affected context

This vulnerability arises in Node.js or browser-based applications that embed fast-xml-parser (versions 4.3.6–5.3.3) to process XML documents from partially or fully untrusted sources.

It specifically affects code paths that:

  • Accept XML input from external clients, files, or third-party integrations
  • Allow numeric entities inside XML content
  • Do not wrap XML parsing calls in robust error-handling constructs

In these contexts, a single malformed numeric entity is sufficient to terminate the parsing process and potentially crash the hosting process.

Exploit preconditions

  • Attack surface: Any endpoint, job, or feature that accepts XML and uses fast-xml-parser internally (HTTP APIs, message consumers, file importers, microservices).
  • Required access: Ability to supply or influence XML content (e.g., HTTP request body, uploaded files, queue messages, webhook payloads, or partner feeds).
  • Trigger point: Parsing of an XML document containing out-of-range numeric entities such as � or �.
  • Why exploitation is possible: The parser attempts to convert invalid numeric entity code points and throws a RangeError that is not caught or normalized, allowing the exception to bubble up and crash the application if the caller does not implement defensive error handling.

Why this happens

The core issue is insufficient validation of numeric entity values before they are converted into character code points.

When an attacker supplies a numeric entity outside the allowable Unicode range, the library attempts to process it directly, resulting in a RangeError at runtime.

Because this exception is not handled within the library, it propagates into the host application, mapping to:

  • CWE-20: Improper Input Validation, as entity values are not checked for valid bounds before processing.
  • CWE-248: Uncaught Exception, as the resulting error is not caught and managed, allowing it to terminate execution paths unexpectedly.

The combination of these patterns turns a malformed XML value into a reliable denial-of-service mechanism.

Potential impact

  • Forced termination of the Node.js process or browser context parsing the XML
  • Denial of service for APIs or microservices that rely on fast-xml-parser for request or message handling
  • Disruption of scheduled jobs, ETL pipelines, or background workers processing XML feeds
  • Potential cascading failures in distributed systems if critical services become unavailable

General mitigation guidance

Effective mitigation focuses on hardening input validation around entity processing and ensuring robust error containment:

  • Validate or normalize XML input before parsing, rejecting documents containing invalid or unusually large numeric entity values.
  • Wrap all fast-xml-parser usage in defensive try/catch (or equivalent) blocks and implement graceful failure paths instead of allowing process-wide crashes.
  • Apply strict limits on input size, structure complexity, and entity usage to reduce the risk surface for malformed or malicious XML.
  • Prefer secure defaults in XML handling configurations (e.g., disabling unnecessary features, limiting entity interpretation when not required).
  • Design services so that the failure of a single XML parsing operation does not propagate into global process termination, using isolation patterns where practical.

How teams detect issues like this

Detection typically combines code-centric review with runtime monitoring:

  • Static analysis and code review:
  • Search for fast-xml-parser usage where untrusted XML is parsed without surrounding error handling.
  • Flag call sites that accept raw client input or third-party feeds and pass them directly to the parser.
  • Review numeric entity handling logic or configuration to ensure bounds checking or sanitization is in place.
  • Runtime monitoring and logging:
  • Monitor for recurring RangeError exceptions related to entity decoding or character code conversion in log streams.
  • Track unexpected process exits or restarts of services that consume XML, especially correlated with suspicious or malformed input payloads.
  • Policy and pipeline checks:
  • Enforce secure parsing patterns via internal coding standards, including mandatory try/catch around XML parsing and validation layers for untrusted data.
  • Use automated review tools or linters to detect unguarded parsing of attacker-controlled XML data.

Sources

SourceLink
github.comgithub.com/NaturalIntelligence/fast-xml-parser/commit/4e387f61c4a5cef792f6a2f42467013290bf95dc
github.comgithub.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.3.4
github.comgithub.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-37qj-frw5-hhjh

Frequently asked

questions

Yes, if a service exposes any interface that accepts XML and passes it to fast-xml-parser, a remote attacker can exploit the issue by sending specially crafted XML containing out-of-range numeric entities.

Not necessarily. Any unauthenticated or low-privilege endpoint that processes XML with the vulnerable parser can be a vector; exploitation only requires the ability to supply or influence XML content.

Combine robust input validation with defensive error handling: ensure numeric entities are validated before processing, wrap XML parsing in try/catch (or equivalent) constructs, and handle failures gracefully without crashing the service.

Adopt a defensive parsing strategy for all untrusted data: validate inputs before parsing, use secure-by-default parser configurations, enforce coding standards that forbid unguarded parsing of external data, and integrate automated checks in CI to flag risky patterns around exception handling and input validation.

Find out what's already
exploitable in your codebase.