CVE-2026-141469 — Fast-xml-parser — CWE-400 · CWE-1333
### Summary Reported by Nikhil Agrawal, Mettle Labs; reproduced only against a clean local install of `[email protected]` on their own machine. `scanAttributeTokens` in `src/validator.js` rescans a leading-whitespace run on every loop iteration when it hits a stray `=`, giving Theta(n^2) time. A few-hundred-KB input stalls the event loop for tens of seconds. Reachable on the default path via both `XMLValidator.validate(xml)` and `new XMLParser().parse(xml, true)`, no non-default options. ### Details `src/validator.js`, `scanAttributeTokens` — on a `=` with no attribute name before it, `i` is reset to one past the **token start**, not past the `=`, so the leading-whitespace scan repeats: ```js function scanAttributeTokens(attrStr) { const tokens = []; const len = attrStr.length; let i = 0; while (i < len) { const tokenStart = i; // Leading whitespace before the name. while (i < len && isWhiteSpace(attrStr[i])) i++; if (i >= len) break; if (attrStr[i] === '=') { // No name before this '=' — not a valid attribute start. i = tokenStart + 1; // <-- rewinds to tokenStart+1, NOT past the '=' -> re-scans the whitespace continue; } ... ``` For an attribute string of the shape `<whitespace run> =`, each outer iteration advances `tokenStart` by one but re-walks the entire remaining whitespace run up to the `=`, so total work is quadratic in the run length. It is reached whenever an element's attribute section is s
### Summary Reported by Nikhil Agrawal, Mettle Labs; reproduced only against a clean local install of `[email protected]` on their own machine. `scanAttributeTokens` in `src/validator.js` rescans a leading-whitespace run on every loop iteration when it hits a stray `=`, giving Theta(n^2) time. A few-hundred-KB input stalls the event loop for tens of seconds. Reachable on the default path via both `XMLValidator.validate(xml)` and `new XMLParser().parse(xml, true)`, no non-default options. ### Details `src/validator.js`, `scanAttributeTokens` — on a `=` with no attribute name before it, `i` is reset to one past the **token start**, not past the `=`, so the leading-whitespace scan repeats: ```js function scanAttributeTokens(attrStr) { const tokens = []; const len = attrStr.length; let i = 0; while (i < len) { const tokenStart = i; // Leading whitespace before the name. while (i < len && isWhiteSpace(attrStr[i])) i++; if (i >= len) break; if (attrStr[i] === '=') { // No name before this '=' — not a valid attribute start. i = tokenStart + 1; // <-- rewinds to tokenStart+1, NOT past the '=' -> re-scans the whitespace continue; } ... ``` For an attribute string of the shape `<whitespace run> =`, each outer iteration advances `tokenStart` by one but re-walks the entire remaining whitespace run up to the `=`, so total work is quadratic in the run length. It is reached whenever an element's attribute section is s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-141469
CVSS 5.3/10 · MEDIUM · 01.12.2026
CWE: CWE-400, CWE-1333
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary
Reported by Nikhil Agrawal, Mettle Labs; reproduced only against a clean local install of [email protected] on their own machine. scanAttributeTokens in src/validator.js rescans a leading-whitespace run on every loop iteration when it hits a stray =, giving Theta(n^2) time. A few-hundred-KB input stalls the event loop for tens of seconds.
Affected: fast-xml-parser
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); reduced availability or partial DoS (A:L).
🛡️ REMEDIATION
→ Apply vendor security update for fast-xml-parser.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]