{"id":"CVE-2026-25896","aliases":["CLSA-2026-1781744119","CLSA-2026-1781744139","CLSA-2026-1789376231","CLSA-2026-1792454133","CLSA-2026-1792488947","DEBIAN-CVE-2026-25896","EUVD-2026-7529","GHSA-m7jm-9gc2-mpf2","ROOT-APP-NPM-CVE-2026-25896","UBUNTU-CVE-2026-25896"],"status":"published","title":"fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","severity":{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00527,"percentile":0.45004,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-185","CWE-79"],"published":"2026-02-20T18:23:54Z","modified":"2026-11-05T13:28:24Z","fixes":[{"ecosystem":"npm","package":"fast-xml-parser","fixed_in":["5.3.5","4.5.4"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:npm","package":"fast-xml-parser","fixed_in":["4.5.1-tuxcare.2"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"fast-xml-parser","fixed_in":["4.4.1-aikido.9","5.2.5-aikido.4","5.3.4-aikido.7","5.3.4-aikido.8","4.2.5-aikido.1","4.2.5-aikido.2","4.5.3-aikido.1","4.5.3-aikido.2","4.5.1-aikido.1","4.5.1-aikido.2","4.5.1-aikido.3","4.5.1-aikido.4","4.5.4-aikido.1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/fast-xml-parser","fixed_in":["5.3.4-root.io.2","4.4.1-root.io.2","5.3.4-root.io.3","4.4.1-root.io.3","4.4.1-root.io.4","5.3.4-root.io.4","4.4.1-root.io.5","4.4.1-root.io.6","4.4.1-root.io.7","5.3.4-root.io.5","5.2.5-root.io.2","4.4.1-root.io.8","5.2.5-root.io.3","5.3.4-root.io.6","4.4.1-root.io.9","5.2.5-root.io.4","5.3.4-root.io.7","5.3.4-root.io.8","4.2.5-root.io.1","4.2.5-root.io.2","4.5.3-root.io.1","4.5.3-root.io.2","4.5.1-root.io.1","4.5.1-root.io.2","4.5.1-root.io.3","4.5.1-root.io.4","4.5.4-root.io.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.3.5"}]}]},{"source":"ghsa","ecosystem":"npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.3"},{"fixed":"4.5.4"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.2.7-tuxcare.0"},{"fixed":"4.2.7-tuxcare.1"}]}],"versions":["4.2.7"],"bundled":6},{"source":"osv","ecosystem":"TuxCare:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.4.0-tuxcare.0"},{"fixed":"4.4.0-tuxcare.1"}]}],"versions":["4.4.0"],"bundled":6},{"source":"osv","ecosystem":"TuxCare:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.5.1-tuxcare.0"},{"fixed":"4.5.1-tuxcare.2"}]}],"versions":["4.5.1","4.5.1-tuxcare.1"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.2.5-tuxcare.0"},{"fixed":"5.2.5-tuxcare.1"}]}],"versions":["5.2.5"],"bundled":7},{"source":"osv","ecosystem":"TuxCare:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.4.1-tuxcare.0"},{"fixed":"4.4.1-tuxcare.1"}]}],"versions":["4.4.1"],"bundled":3},{"source":"osv","ecosystem":"Debian:12","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-10","11.4.0+dfsg2+~cs35.7.26-11","11.4.0+dfsg2+~cs35.7.26-12","11.4.0+dfsg2+~cs35.7.26-13","11.4.0+dfsg2+~cs35.7.26-14","11.4.0+dfsg2+~cs35.7.26-15","11.4.0+dfsg2+~cs35.7.26-16","11.4.0+dfsg2+~cs35.7.26-18","11.4.0+dfsg2+~cs35.7.26-19","11.4.0+dfsg2+~cs35.7.26-20","11.4.0+dfsg2+~cs35.7.26-21","11.4.0+dfsg2+~cs35.7.26-7","11.4.0+dfsg2+~cs35.7.26-8","11.4.0+dfsg2+~cs35.7.26-9"]},{"source":"osv","ecosystem":"Debian:13","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-13","11.4.0+dfsg2+~cs35.7.26-14","11.4.0+dfsg2+~cs35.7.26-15","11.4.0+dfsg2+~cs35.7.26-16","11.4.0+dfsg2+~cs35.7.26-18","11.4.0+dfsg2+~cs35.7.26-19","11.4.0+dfsg2+~cs35.7.26-20","11.4.0+dfsg2+~cs35.7.26-21"]},{"source":"osv","ecosystem":"Debian:14","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-13","11.4.0+dfsg2+~cs35.7.26-14","11.4.0+dfsg2+~cs35.7.26-15","11.4.0+dfsg2+~cs35.7.26-16","11.4.0+dfsg2+~cs35.7.26-18","11.4.0+dfsg2+~cs35.7.26-19","11.4.0+dfsg2+~cs35.7.26-20","11.4.0+dfsg2+~cs35.7.26-21"]},{"source":"osv","ecosystem":"npm","package":"fast-xml-parser","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0"},{"fixed":"5.3.5"}]}]},{"source":"osv","ecosystem":"npm","package":"fast-xml-parser","ranges":[{"type":"SEMVER","events":[{"introduced":"4.1.3"},{"fixed":"4.5.4"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.4.1-aikido.9"},{"fixed":"5.2.5-aikido.4"},{"fixed":"5.3.4-aikido.7"},{"fixed":"5.3.4-aikido.8"},{"fixed":"4.2.5-aikido.1"},{"fixed":"4.2.5-aikido.2"},{"fixed":"4.5.3-aikido.1"},{"fixed":"4.5.3-aikido.2"},{"fixed":"4.5.1-aikido.1"},{"fixed":"4.5.1-aikido.2"},{"fixed":"4.5.1-aikido.3"},{"fixed":"4.5.1-aikido.4"},{"fixed":"4.5.4-aikido.1"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/fast-xml-parser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.3.4-root.io.2"},{"fixed":"4.4.1-root.io.2"},{"fixed":"5.3.4-root.io.3"},{"fixed":"4.4.1-root.io.3"},{"fixed":"4.4.1-root.io.4"},{"fixed":"5.3.4-root.io.4"},{"fixed":"4.4.1-root.io.5"},{"fixed":"4.4.1-root.io.6"},{"fixed":"4.4.1-root.io.7"},{"fixed":"5.3.4-root.io.5"},{"fixed":"5.2.5-root.io.2"},{"fixed":"4.4.1-root.io.8"},{"fixed":"5.2.5-root.io.3"},{"fixed":"5.3.4-root.io.6"},{"fixed":"4.4.1-root.io.9"},{"fixed":"5.2.5-root.io.4"},{"fixed":"5.3.4-root.io.7"},{"fixed":"5.3.4-root.io.8"},{"fixed":"4.2.5-root.io.1"},{"fixed":"4.2.5-root.io.2"},{"fixed":"4.5.3-root.io.1"},{"fixed":"4.5.3-root.io.2"},{"fixed":"4.5.1-root.io.1"},{"fixed":"4.5.1-root.io.2"},{"fixed":"4.5.1-root.io.3"},{"fixed":"4.5.1-root.io.4"},{"fixed":"4.5.4-root.io.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-7ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-10","11.4.0+dfsg2+~cs35.7.26-13ubuntu2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-18","11.4.0+dfsg2+~cs35.7.26-19"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"node-webfont","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["11.4.0+dfsg2+~cs35.7.26-13ubuntu2","11.4.0+dfsg2+~cs35.7.26-14","11.4.0+dfsg2+~cs35.7.26-15","11.4.0+dfsg2+~cs35.7.26-16build1","11.4.0+dfsg2+~cs35.7.26-18"]}],"products":[{"vendor":"naturalintelligence","product":"fast-xml-parser"},{"vendor":"red hat","product":"migration toolkit for applications 8"},{"vendor":"red hat","product":"red hat advanced cluster security 4.8"},{"vendor":"red hat","product":"red hat advanced cluster security 4.9"},{"vendor":"red hat","product":"red hat developer hub 1.8"},{"vendor":"red hat","product":"red hat developer hub 1.9"},{"vendor":"red hat","product":"red hat openshift data foundation 4.18"},{"vendor":"red hat","product":"red hat openshift data foundation 4.19"},{"vendor":"red hat","product":"red hat openshift data foundation 4.20"},{"vendor":"red hat","product":"red hat openshift gitops"},{"vendor":"red hat","product":"red hat openshift virtualization 4"},{"vendor":"red hat","product":"red hat satellite 6"},{"vendor":"red hat","product":"red hat satellite 6.18"},{"vendor":"red hat","product":"self-service automation portal 2"}],"references":[{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-m7jm-9gc2-mpf2","tags":["x_refsource_CONFIRM","Exploit","Mitigation","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/commit/943ef0eb1b2d3284e72dd74f44a042ee9f07026e","tags":["x_refsource_MISC","Patch","fix","web","report"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/commit/ddcd0acf26ddd682cb0dc15a2bd6aa3b96bb1e69","tags":["x_refsource_MISC","Patch","fix","web","report"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.3.5","tags":["x_refsource_MISC","Product","Release Notes","web","report"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-25896","tags":["vdb-entry","x_refsource_REDHAT","advisory"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2441501","tags":["issue-tracking","x_refsource_REDHAT","report"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25896.json","tags":["x_sadp-csaf-vex","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:7110","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:7128","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:6174","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:6802","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:41941","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:41944","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:40984","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:51349","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25896","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-m7jm-9gc2-mpf2"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/25xxx/CVE-2026-25896.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-25896","tags":["advisory"]},{"url":"https://github.com/NaturalIntelligence/fast-xml-parser","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-25896","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-25896","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-25896","title":"fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T20:57:48.074Z","modified":"2026-09-10T12:04:52.028Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical","assessor":"cna"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"high","assessor":"adp"}],"cwes":["CWE-185","CWE-79"],"updated_at":"2026-11-02T13:41:30.911526Z"}],"euvd":[{"id":"EUVD-2026-7529","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T20:57:48Z","modified":"2026-09-10T12:04:52Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"updated_at":"2026-11-02T17:28:25.63332Z"}],"ghsa":[{"id":"GHSA-m7jm-9gc2-mpf2","title":"fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names","description":"# Entity encoding bypass via regex injection in DOCTYPE entity names\n\n## Summary\n\nA dot (`.`) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (`\u0026lt;`, `\u0026gt;`, `\u0026amp;`, `\u0026quot;`, `\u0026apos;`) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered.\n\n## Details\n\nThe fix for CVE-2023-34104 addressed some regex metacharacters in entity names but missed `.` (period), which is valid in XML names per the W3C spec.\n\nIn `DocTypeReader.js`, entity names are passed directly to `RegExp()`:\n\n```js\nentities[entityName] = {\n    regx: RegExp(`\u0026${entityName};`, \"g\"),\n    val: val\n};\n```\n\nAn entity named `l.` produces the regex `/\u0026l.;/g` where `.` matches **any character**, including the `t` in `\u0026lt;`. Since DOCTYPE entities are replaced before built-in entities, this shadows `\u0026lt;` entirely.\n\nThe same issue exists in `OrderedObjParser.js:81` (`addExternalEntities`), and in the v6 codebase - `EntitiesParser.js` has a `validateEntityName` function with a character blacklist, but `.` is not included:\n\n```js\n// v6 EntitiesParser.js line 96\nconst specialChar = \"!?\\\\/[]$%{}^\u0026*()\u003c\u003e|+\";  // no dot\n```\n\n## Shadowing all 5 built-in entities\n\n| Entity name | Regex created | Shadows |\n|---|---|---|\n| `l.` | `/\u0026l.;/g` | `\u0026lt;` |\n| `g.` | `/\u0026g.;/g` | `\u0026gt;` |\n| `am.` | `/\u0026am.;/g` | `\u0026amp;` |\n| `quo.` | `/\u0026quo.;/g` | `\u0026quot;` |\n| `apo.` | `/\u0026apo.;/g` | `\u0026apos;` |\n\n## PoC\n\n```js\nconst { XMLParser } = require(\"fast-xml-parser\");\n\nconst xml = `\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE foo [\n  \u003c!ENTITY l. \"\u003cimg src=x onerror=alert(1)\u003e\"\u003e\n]\u003e\n\u003croot\u003e\n  \u003ctext\u003eHello \u0026lt;b\u0026gt;World\u0026lt;/b\u0026gt;\u003c/text\u003e\n\u003c/root\u003e`;\n\nconst result = new XMLParser().parse(xml);\nconsole.log(result.root.text);\n// Hello \u003cimg src=x onerror=alert(1)\u003eb\u003eWorld\u003cimg src=x onerror=alert(1)\u003e/b\u003e\n```\n\nNo special parser options needed - `processEntities: true` is the default.\n\nWhen an app renders `result.root.text` in a page (e.g. `innerHTML`, template interpolation, SSR), the injected `\u003cimg onerror\u003e` fires.\n\n`\u0026amp;` can be shadowed too:\n\n```js\nconst xml2 = `\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE foo [\n  \u003c!ENTITY am. \"'; DROP TABLE users;--\"\u003e\n]\u003e\n\u003croot\u003eSELECT * FROM t WHERE name='O\u0026amp;Brien'\u003c/root\u003e`;\n\nconst r = new XMLParser().parse(xml2);\nconsole.log(r.root);\n// SELECT * FROM t WHERE name='O'; DROP TABLE users;--Brien'\n```\n\n## Impact\n\nThis is a complete bypass of XML entity encoding. Any application that parses untrusted XML and uses the output in HTML, SQL, or other injection-sensitive contexts is affected.\n\n- Default config, no special options\n- Attacker can replace any `\u0026lt;` / `\u0026gt;` / `\u0026amp;` / `\u0026quot;` / `\u0026apos;` with arbitrary strings\n- Direct XSS vector when parsed XML content is rendered in a page\n- v5 and v6 both affected\n\n## Suggested fix\n\nEscape regex metacharacters before constructing the replacement regex:\n\n```js\nconst escaped = entityName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$\u0026');\nentities[entityName] = {\n    regx: RegExp(`\u0026${escaped};`, \"g\"),\n    val: val\n};\n```\n\nFor v6, add `.` to the blacklist in `validateEntityName`:\n\n```js\nconst specialChar = \"!?\\\\/[].{}^\u0026*()\u003c\u003e|+\";\n```\n\n## Severity\n\n**CWE-185** (Incorrect Regular Expression)\n\n**CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - 9.3 (CRITICAL)**\n\nEntity decoding is a fundamental trust boundary in XML processing. This completely undermines it with no preconditions.","status":"published","published":"2026-02-20T18:23:54Z","modified":"2026-02-27T16:51:59Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T14:39:28.962954Z"}],"nvd":[{"id":"CVE-2026-25896","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T21:19:27.47Z","modified":"2026-09-10T13:17:54.697Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical","assessor":"secondary"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"high","assessor":"secondary"}],"cwes":["CWE-185","CWE-79"],"updated_at":"2026-11-02T14:12:06.63895Z"}],"osv":[{"id":"CVE-2026-25896","title":"fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T20:57:48.074Z","modified":"2026-10-28T02:31:08.179347538Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T15:44:59.80315Z"},{"id":"DEBIAN-CVE-2026-25896","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T21:19:27.47Z","modified":"2026-10-01T03:03:00.965751917Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"updated_at":"2026-11-02T15:45:53.877573Z"},{"id":"GHSA-m7jm-9gc2-mpf2","title":"fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names","description":"# Entity encoding bypass via regex injection in DOCTYPE entity names\n\n## Summary\n\nA dot (`.`) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (`\u0026lt;`, `\u0026gt;`, `\u0026amp;`, `\u0026quot;`, `\u0026apos;`) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered.\n\n## Details\n\nThe fix for CVE-2023-34104 addressed some regex metacharacters in entity names but missed `.` (period), which is valid in XML names per the W3C spec.\n\nIn `DocTypeReader.js`, entity names are passed directly to `RegExp()`:\n\n```js\nentities[entityName] = {\n    regx: RegExp(`\u0026${entityName};`, \"g\"),\n    val: val\n};\n```\n\nAn entity named `l.` produces the regex `/\u0026l.;/g` where `.` matches **any character**, including the `t` in `\u0026lt;`. Since DOCTYPE entities are replaced before built-in entities, this shadows `\u0026lt;` entirely.\n\nThe same issue exists in `OrderedObjParser.js:81` (`addExternalEntities`), and in the v6 codebase - `EntitiesParser.js` has a `validateEntityName` function with a character blacklist, but `.` is not included:\n\n```js\n// v6 EntitiesParser.js line 96\nconst specialChar = \"!?\\\\/[]$%{}^\u0026*()\u003c\u003e|+\";  // no dot\n```\n\n## Shadowing all 5 built-in entities\n\n| Entity name | Regex created | Shadows |\n|---|---|---|\n| `l.` | `/\u0026l.;/g` | `\u0026lt;` |\n| `g.` | `/\u0026g.;/g` | `\u0026gt;` |\n| `am.` | `/\u0026am.;/g` | `\u0026amp;` |\n| `quo.` | `/\u0026quo.;/g` | `\u0026quot;` |\n| `apo.` | `/\u0026apo.;/g` | `\u0026apos;` |\n\n## PoC\n\n```js\nconst { XMLParser } = require(\"fast-xml-parser\");\n\nconst xml = `\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE foo [\n  \u003c!ENTITY l. \"\u003cimg src=x onerror=alert(1)\u003e\"\u003e\n]\u003e\n\u003croot\u003e\n  \u003ctext\u003eHello \u0026lt;b\u0026gt;World\u0026lt;/b\u0026gt;\u003c/text\u003e\n\u003c/root\u003e`;\n\nconst result = new XMLParser().parse(xml);\nconsole.log(result.root.text);\n// Hello \u003cimg src=x onerror=alert(1)\u003eb\u003eWorld\u003cimg src=x onerror=alert(1)\u003e/b\u003e\n```\n\nNo special parser options needed - `processEntities: true` is the default.\n\nWhen an app renders `result.root.text` in a page (e.g. `innerHTML`, template interpolation, SSR), the injected `\u003cimg onerror\u003e` fires.\n\n`\u0026amp;` can be shadowed too:\n\n```js\nconst xml2 = `\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE foo [\n  \u003c!ENTITY am. \"'; DROP TABLE users;--\"\u003e\n]\u003e\n\u003croot\u003eSELECT * FROM t WHERE name='O\u0026amp;Brien'\u003c/root\u003e`;\n\nconst r = new XMLParser().parse(xml2);\nconsole.log(r.root);\n// SELECT * FROM t WHERE name='O'; DROP TABLE users;--Brien'\n```\n\n## Impact\n\nThis is a complete bypass of XML entity encoding. Any application that parses untrusted XML and uses the output in HTML, SQL, or other injection-sensitive contexts is affected.\n\n- Default config, no special options\n- Attacker can replace any `\u0026lt;` / `\u0026gt;` / `\u0026amp;` / `\u0026quot;` / `\u0026apos;` with arbitrary strings\n- Direct XSS vector when parsed XML content is rendered in a page\n- v5 and v6 both affected\n\n## Suggested fix\n\nEscape regex metacharacters before constructing the replacement regex:\n\n```js\nconst escaped = entityName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$\u0026');\nentities[entityName] = {\n    regx: RegExp(`\u0026${escaped};`, \"g\"),\n    val: val\n};\n```\n\nFor v6, add `.` to the blacklist in `validateEntityName`:\n\n```js\nconst specialChar = \"!?\\\\/[].{}^\u0026*()\u003c\u003e|+\";\n```\n\n## Severity\n\n**CWE-185** (Incorrect Regular Expression)\n\n**CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - 9.3 (CRITICAL)**\n\nEntity decoding is a fundamental trust boundary in XML processing. This completely undermines it with no preconditions.","status":"published","published":"2026-02-20T18:23:54Z","modified":"2026-09-10T03:50:35.317514651Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T15:46:51.463834Z"},{"id":"ROOT-APP-NPM-CVE-2026-25896","title":"CVE-2026-25896 in fast-xml-parser - Patched by Root","description":"Root has patched CVE-2026-25896 in the fast-xml-parser package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-11-02T16:57:32Z","modified":"2026-11-02T17:15:03.174569904Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"}],"updated_at":"2026-11-02T18:00:32.560004Z"},{"id":"UBUNTU-CVE-2026-25896","description":"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. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (\u0026lt;, \u0026gt;, \u0026amp;, \u0026quot;, \u0026apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","status":"published","published":"2026-02-20T21:19:00Z","modified":"2026-10-17T12:56:12.580940623Z","cvss":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","level":"critical"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T16:56:08.726452Z"},{"id":"CLSA-2026-1781744119","title":"TuxCare security update for fast-xml-parser (6 CVEs)","description":"TuxCare rebuilt fast-xml-parser to address 6 CVEs. Fixed in 4.2.7-tuxcare.1.","status":"published","published":"2026-08-04T14:52:37Z","modified":"2026-10-15T09:45:51.439601431Z","updated_at":"2026-11-02T15:43:45.794021Z"},{"id":"CLSA-2026-1781744139","title":"TuxCare security update for fast-xml-parser (6 CVEs)","description":"TuxCare rebuilt fast-xml-parser to address 6 CVEs. Fixed in 4.4.0-tuxcare.1.","status":"published","published":"2026-08-04T14:52:38Z","modified":"2026-11-05T13:28:24.682022025Z","updated_at":"2026-11-05T16:37:45.64821Z"},{"id":"CLSA-2026-1789376231","title":"TuxCare security update for fast-xml-parser (1 CVE)","description":"TuxCare rebuilt fast-xml-parser to address 1 CVE. Fixed in 4.5.1-tuxcare.2.","status":"published","published":"2026-09-14T08:57:11Z","modified":"2026-10-15T09:48:03.877275508Z","updated_at":"2026-11-02T15:43:47.938828Z"},{"id":"CLSA-2026-1792454133","title":"TuxCare security update for fast-xml-parser (7 CVEs)","description":"TuxCare rebuilt fast-xml-parser to address 7 CVEs. Fixed in 5.2.5-tuxcare.1.","status":"published","published":"2026-10-19T23:55:33Z","modified":"2026-10-20T01:45:13.504283365Z","updated_at":"2026-11-02T15:43:54.378946Z"},{"id":"CLSA-2026-1792488947","title":"TuxCare security update for fast-xml-parser (3 CVEs)","description":"TuxCare rebuilt fast-xml-parser to address 3 CVEs. Fixed in 4.4.1-tuxcare.1.","status":"published","published":"2026-10-20T09:35:47Z","modified":"2026-10-20T13:45:11.480018298Z","updated_at":"2026-11-02T15:43:54.378946Z"}]}}
