---
title: "GHSA-474x-hrwr-fgx4: fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags"
description: "Low severity. fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags. Affects fast-xml-parser; fixed in 5.12.0."
url: https://inlinr.com/advisories/GHSA-474x-hrwr-fgx4
lang: en
---

[Packages](https://inlinr.com/packages) / [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser) / [Security](https://inlinr.com/packages/fast-xml-parser/security)

Low Vulnerability GHSA-474x-hrwr-fgx4 CVE-2026-126066 Published 10 Nov 2026

# fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags

Your version 

Affected releases · [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser)

- 5.x 5.0.0 – 5.11.2 Fixed in 5.12.0
- 4.x 4.0.0 – 4.5.7 No fix on this line yet
- 3.x and older 1.0.0 – 3.21.1 No fix, no longer updated

On 5.x, the newest line:

```
npm install fast-xml-parser@5.12.0
```

Every release on a timeline

5.x 

1. Affected

5.0.0 – 5.11.2  
58 releases
2. Fixed

5.12.0 – 5.12.1  
2 releases, latest

4.x 

1. Affected

4.0.0 – 4.5.7  
46 releases

3.x 

1. Affected

3.0.0 – 3.21.1  
60 releases

2.x 

1. Affected

2.0.0 – 2.9.4  
26 releases

1.x 

1. Affected

1.0.0 – 1.1.1  
3 releases

195 stable releases of fast-xml-parser, oldest to newest, one row per major.

## What happens

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()` calls `readStopNodeData()` after a matching stop node opens
- `OrderedObjParser.js:810` — calls `readTagExp()` for every non-special `<`
- `OrderedObjParser.js:688-722` — `tagExpWithClosingIndex()` scans to end-of-input and returns `undefined` when no `>` exists
- `OrderedObjParser.js:812-818` — on failure, `i` isn't advanced, so the next `<` repeats the same full scan
- `OrderedObjParser.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**

1. Throw immediately in `readStopNodeData()` when `readTagExp()` returns `undefined`
2. Or break the loop on the first failed scan
3. Or find the next `>` once and reuse/bound that result
4. 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).

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: none
- **Availability**: low

CVSS:3.1/​AV:N/​AC:H/​PR:N/​UI:N/​S:U/​C:N/​I:N/​A:L

## References

- [Reference](https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-474x-hrwr-fgx4 "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-474x-hrwr-fgx4")  
github.com/NaturalIntelligence/fast-xml-parser/…
- [Fix commit](https://github.com/NaturalIntelligence/fast-xml-parser/commit/0c3659348364959da62954b73728fb3bd05ebcb4 "https://github.com/NaturalIntelligence/fast-xml-parser/commit/0c3659348364959da62954b73728fb3bd05ebcb4")  
0c36593
- [Package](https://github.com/NaturalIntelligence/fast-xml-parser "https://github.com/NaturalIntelligence/fast-xml-parser")  
github.com/NaturalIntelligence/fast-xml-parser
- [Reference](https://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.12.0 "https://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.12.0")  
github.com/NaturalIntelligence/fast-xml-parser/…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
