Public research

fast-xml-parser

CVE-2026-73569 · GHSA-8r6m-32jq-jx6q
Repeated `DOCTYPE` declarations reset entity-expansion limits

High, 8.7 · Public source snapshot: November 12, 2026

Original portfolio report · Public advisory · CVE record

Shared credits and the scope of my investigation are documented below.

CVE-2026-73569 · GHSA-8r6m-32jq-jx6q · fast-xml-parser · High

Public security research by Charles Vosburgh (the-vibe-dev).

Field Value
Package fast-xml-parser
Ecosystem npm / Node.js
Severity High
CVSS 8.7 — CVSS 4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Public affected range >= 5.9.3, < 5.10.1
Fixed 5.10.1
Weakness CWE-776 — Improper Restriction of Recursive Entity References in DTDs
Public PoC Yes
Credit Charles Vosburgh (the-vibe-dev) — researcher and reporter

fast-xml-parser exposes limits such as maxTotalExpansions and maxExpandedLength to constrain entity-expansion work across one XML document. In affected releases, those limits could be bypassed by placing another DOCTYPE declaration between groups of entity references.

The parser passed each declaration to @nodable/entities. Its addInputEntities() routine reset the entity-expansion counters whenever a new declaration was supplied. Because the XML parser accepted repeated DOCTYPE declarations inside one parse, an attacker could divide one document into multiple accounting windows. Each window stayed under the configured limit while the total expansion across the document exceeded it.

This is a resource-control bypass. It does not depend on external entities, local file access, session state, or a classic recursive “Billion Laughs” construction.

Security invariant: Expansion accounting and declaration state must be scoped to the entire XML document and must not be reset by attacker-controlled syntax within that document.

A parser limit only works if the counter lifetime matches the security boundary it claims to protect. In this case the intended boundary is a single call to XMLParser.parse().

At the beginning of a parse, resetting the decoder and expansion counters is correct:

this.matcher.reset();
this.entityDecoder.reset();

this.entityExpansionCount = 0;
this.currentExpandedLength = 0;

The problem appears later. In affected source, the XML scanner accepts every <!DOCTYPE token it encounters and sends the newly parsed entity declarations to the decoder:

} else if (c1 === 33
  && xmlData.charCodeAt(i + 2) === 68) { //'!D'
  const result = docTypeReader.readDocType(xmlData, i);
  this.entityDecoder.addInputEntities(result.entities);
  i = result.i;
}

In the relevant @nodable/entities implementation, addInputEntities() resets both document counters:

addInputEntities(map) {
  this._totalExpansions = 0;
  this._expandedLength = 0;
  // replace entity map
}

The ordinary decode path still increments and checks those counters. The security checks are therefore present and functional; the flaw is that their lifetime can be reset from inside the attacker-controlled document.

Bounded proof

A small validation configuration used:

maxTotalExpansions: 10
maxExpandedLength: 1000

Three documents isolate the behavior:

  1. Allowed control: one declaration followed by ten 100-character expansions. It stays within the 1,000-character ceiling.
  2. Negative control: one declaration followed by twenty references. The parser rejects the aggregate expansion as expected.
  3. Bypass candidate: the same twenty references split around a second DOCTYPE. Affected releases reset the counters at the second declaration and produce 2,000 expanded characters even though the configured document limit is 1,000.

This differential proof is useful because it shows that the expansion limit itself works. The bypass depends specifically on the repeated-declaration reset.

Two components had incompatible assumptions about state lifetime:

  • fast-xml-parser allowed more than one DOCTYPE declaration during a single document parse.
  • @nodable/entities.addInputEntities() treated each declaration as a fresh accounting scope and zeroed the expansion counters.

Combined, those behaviors converted a document-wide limit into a per-declaration limit controlled by the attacker.

flowchart TD
    A[Application parses attacker-controlled XML]
    B[First DOCTYPE installs entities and expansion begins]
    C[Expansion counters approach configured ceiling]
    D[Second DOCTYPE is accepted]
    E[addInputEntities resets total-expansion and length counters]
    F[Additional entity expansion proceeds under a fresh budget]
    G[Document-wide resource limit is bypassed]
    A --> B --> C --> D --> E --> F --> G

The PoC is public with GHSA-8r6m-32jq-jx6q and is not duplicated as a separate artifact in this repository.

The public reproduction is intentionally bounded. It demonstrates limit bypass without attempting to exhaust a machine. Exact public releases 5.9.3 and 5.10.0 produced 2,000 expanded characters under the 1,000-character configured ceiling, while 5.10.1 rejected the repeated declaration.

Adjacent-version checks also reproduced the underlying behavior on 5.9.2 and 5.6.0. Those results are important for research accuracy because they show that 5.9.3 should not be described as a source-proven introduction point even though it remains the lower bound in the publisher's public advisory.

No process-exhaustion or destructive stress test is required to validate the flaw.

The controlling public advisory range is:

>= 5.9.3, < 5.10.1

The verified fixed release is:

5.10.1

Public history points to commit:

169fbf94699087087012e4ed68f8c2b30dd948f3

as the apparent introduction of the vulnerable @nodable/entities integration. The earliest release reproduced during this research was 5.6.0. Releases 5.7.0, 5.7.1, 5.7.2, 5.7.3, 5.8.0, 5.9.0, and 5.9.1 were not all runtime-tested, so this write-up does not independently replace the publisher's affected-version range.

The fixing change is:

4e546e03987662de5495d050b5fba26bea65383f

and is included in 5.10.1.

The public fix rejects repeated declarations in the parser path before the decoder can reset the counters. One adjacent behavior deserves separate treatment: during bounded checks, XMLValidator could still report the repeated-declaration input as valid while XMLParser rejected it. That distinction should be considered by applications that use validation as a security precondition before parsing.

The demonstrated impact is deterministic defeat of document-wide entity-expansion accounting. An application parsing larger attacker-controlled XML synchronously can therefore perform more entity replacement work than its configured limits were intended to allow.

The published advisory identifies the practical consequences as excessive CPU use, event-loop blocking, memory pressure/exhaustion, and possible process termination. This write-up does not claim memory corruption, arbitrary code execution, file disclosure, or persistence.

Network reachability is application-dependent. fast-xml-parser is a library, not a network service; an HTTP or other remote attack requires a consuming application to feed remote XML into the affected parser configuration.

The public advisory rates the issue High, CVSS 8.7 under CVSS 4.0.

Upgrade to fast-xml-parser 5.10.1 or later.

For parser implementers, maintain document-scoped security state outside helpers whose lifecycle can be reset by grammar events. A declaration parser may update the entity map, but it should not be able to reset resource counters that represent work already performed in the same document.

Regression coverage should include:

  • one allowed declaration at the limit;
  • one declaration exceeding the limit;
  • multiple declarations split around references;
  • repeated declarations with zero entities;
  • parser and validator agreement on declaration legality;
  • assertions that counters never decrease during one parse.
Date Event
2026-07-16 GitHub Security Advisory published.
2026-08-13 CVE-2026-73569 published.
2026-08-26 Public PoC and bounded release controls reviewed.

CVE-2026-73569 / GHSA-8r6m-32jq-jx6q is a state-lifetime flaw in XML entity-expansion accounting. The parser enforced expansion ceilings, but repeated attacker-controlled declarations reset the counters inside the same document. Version 5.10.1 closes the published path by rejecting the repeated-declaration condition before it can reopen the accounting budget.

Broader lesson: Resource limits are only as strong as the lifetime of the state that measures them. Attacker-controlled grammar events must never be able to reset document-wide security accounting.

  • https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-8r6m-32jq-jx6q
  • https://www.cve.org/CVERecord?id=CVE-2026-73569

Charles Vosburgh (the-vibe-dev) — researcher and reporter.

Research was AI-assisted for source mapping, hypothesis generation, release comparison, and evidence organization. I performed the final validation, disclosure coordination, severity calibration, and publication review.

This write-up documents a publicly disclosed parser vulnerability for defensive research, remediation, regression testing, and authorized assessment. Keep reproductions bounded and run them only on systems you own or are explicitly authorized to test.