CVE-2026-126066
fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags
Description
Summary
With 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.
Details
CWE-407 — Inefficient Algorithmic Complexity
Code
OrderedObjParser.js:520—parseXml()callsreadStopNodeData()after a matching stop node opensOrderedObjParser.js:810— callsreadTagExp()for every non-special<OrderedObjParser.js:688-722—tagExpWithClosingIndex()scans to end-of-input and returnsundefinedwhen no>existsOrderedObjParser.js:812-818— on failure,iisn'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 retries
Root 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
- Throw immediately in
readStopNodeData()whenreadTagExp()returnsundefined - Or break the loop on the first failed scan
- Or find the next
>once and reuse/bound that result - Add a test asserting near-linear scaling when payload size doubles
Proof of concept
Not 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.
Impact
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).
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » fast-xml-parservia npm fast-xml-parser | < 5.12.0 | 5.12.0 |
| org.webjars.npm » fast-xml-parservia npm fast-xml-parser | < 5.12.0 | 5.12.0 |
Blast radius
37% of the dependent artifacts (15) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 24 |
| 2 hops | 424 |
| 3 hops | 406 |
| 4 hops | 261 |
| 5 hops | 51 |
Most used dependents
- org.mvnpm.at.aws-sdk » core35 usages
- org.mvnpm.at.aws-sdk » credential-provider-node12 usages
- org.mvnpm.at.aws-sdk » middleware-user-agent11 usages
- org.mvnpm.at.aws-sdk » util-user-agent-node10 usages
- org.eclipse.dirigible » dirigible-components-group-ui9 usages
- org.eclipse.dirigible » dirigible-components-group-resources8 usages
- org.eclipse.dirigible » dirigible-components-group-ide7 usages
- org.mvnpm.at.aws-sdk » client-sts6 usages
- org.mvnpm » aws-amplify6 usages
- org.mvnpm.at.aws-sdk » client-sso-oidc5 usages
- org.mvnpm.at.aws-sdk » nested-clients5 usages
- org.eclipse.dirigible » dirigible-components-group-resources-core4 usages
- org.eclipse.dirigible » dirigible-components-resources-resources4 usages
- org.webjars.npm » bpmn-visualization4 usages
- org.eclipse.dirigible » dirigible-components-ui-perspective-processes3 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
- Webhttps://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-474x-hrwr-fgx4
- Webhttps://github.com/NaturalIntelligence/fast-xml-parser/commit/0c3659348364959da62954b73728fb3bd05ebcb4
- Packagehttps://github.com/NaturalIntelligence/fast-xml-parser
- Webhttps://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.12.0
