Packages / fast-xml-parser / Security

HighVulnerabilityGHSA-8r6m-32jq-jx6qCVE-2026-73569Published 21 Jul 2026

fast-xml-parser: Repeated DOCTYPE declarations reset entity expansion limits

Your version

Affected releases · fast-xml-parser

  • 5.x5.9.3 – 5.10.0Fixed in 5.10.1

On 5.x, the newest line:

npm install fast-xml-parser@5.10.1
Every release on a timeline
  1. Not affected

    1.0.0 – 5.9.2

    187 releases

  2. Affected

    5.9.3 – 5.10.0

    2 releases

  3. Fixed

    5.10.1 – 5.12.1

    6 releases, latest

195 stable releases of fast-xml-parser, oldest to newest.

What happens

Impact

fast-xml-parser processes multiple "DOCTYPE" declarations within a single XML document. Each declaration passes its entities to @nodable/entities through addInputEntities().

addInputEntities() resets the entity expansion counters every time it is called. An attacker can therefore insert additional DOCTYPE declarations to repeatedly reset maxTotalExpansions and maxExpandedLength during one parse operation.

This allows a crafted XML document to exceed the configured entity-expansion limits and can cause excessive CPU use, event-loop blocking, memory exhaustion, and process termination.

Workarounds

  • Manually check if multiple DOCTYPEs are not present in input contents

  • Update to v5.10.1

  • Keep processEntity flag off

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.