FAST-XML-PARSER · CVE-2026-126066 · Package
FIX → 5.12.0
fast-xml-parser versions up to 5.11.2 take quadratic time to parse a stop-node body containing many unterminated "<a " fragments when the non-default stopNodes option is set. An attacker who can send XML to such a parser can stall the event loop and exhaust CPU, causing denial of service with no data exposure.
first public Nov 3, 2026 · 2 sources
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Only applications that call fast-xml-parser with the non-default stopNodes option and parse XML from untrusted input are exposed. Projects that leave stopNodes unset, or parse only trusted XML, can skip it.
Not affected if default-config, trusted-input
Who cares fast-xml-parser, node.js, xml-parsing
npm ls fast-xml-parser; affected versions are 5.11.2 and earlier.stopNodes in calls to the parser; the bug only applies when that option is set.Upgrade to 5.12.0
fast-xml-parser 5.12.0With the non-default stopNodes option, a stop node's body with many "<a " fragments and no closing ">" anywhere after makes readStopNodeData() rescan the entire remaining input from every "<". The failed lookahead is neither cached nor bounded, so n fragments cost O(n²) before the parser throws. Availability-only (CPU exhaustion), needs the non-default stopNodes option — not benchmarked yet, see Proof of Concept.
CWE-407 — Inefficient Algorithmic Complexity
Code
OrderedObjParser.js:520 — parseXml() calls readStopNodeData() after a matching stop node opensOrderedObjParser.js:810 — calls readTagExp() for every non-special <OrderedObjParser.js:688-722 — tagExpWithClosingIndex() scans to end-of-input and returns undefined when no > existsCheck it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
OrderedObjParser.js:812-818 — on failure, i isn't advanced, so the next < repeats the same full scanOrderedObjParser.js:423 — the main parse loop throws immediately on the same failure; only the stop-node path retriesRoot cause: a failed closing-> lookahead is neither cached nor bounded — n copies of <a with no later > means n scans over the remaining input, O(n²) work, before it finally throws.
Fix
readStopNodeData() when readTagExp() returns undefined> once and reuse/bound that resultNot benchmarked — static-analysis finding, confidence 0.5.
To confirm: configure stopNodes matching a root element. Build input as '<stop>' + '<a '.repeat(n). Time parse() until it throws Unexpected end of <tag>. Start around n=10,000 and double it — quadratic should show ~4x time per doubling, linear ~2x. Control: same input with a > present, or stopNodes unset.
CPU-exhaustion DoS in Node.js services parsing untrusted XML with stopNodes enabled. A ~100KB payload is estimated at ~10⁹ character operations (roughly a second or more of blocked event loop) — analytical estimate, not a benchmark. No confidentiality/integrity impact. CVSS 3.1: AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L (3.7, Low).
This page as .md · .json · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.