{"vuln_id":"CVE-2026-25896","aliases":[],"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 (&lt;, &gt;, &amp;, &quot;, &apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.","published_at":"2026-02-20T21:19:27.470000Z","modified_at":"2026-09-10T13:17:54.697000Z","first_seen_at":"2026-11-21T19:15:20.158027Z","severity":"critical","severity_source":"nvd","cvss_score":9.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","cwe":["CWE-185","CWE-79"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.0052,"epss_percentile":0.45026,"nvd_status":"Modified","enriched_at":"2026-11-22T13:36:22.674455Z","links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-25896"},"matched_alias":null,"items":[{"id":2445,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-gh4j-gqv2-49f6 / CVE-2026-41650: fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters","summary":"fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters\n\n# fast-xml-parser XMLBuilder: Comment and CDATA Injection via Unescaped Delimiters\n\n## Summary\n\nfast-xml-parser v5.5.12 (latest) XMLBuilder does not escape the `-->` sequence in comment content or the `]]>` sequence in CDATA sections when building XML from JavaScript objects. This allows XML injection when user-controlled data flows into comments or CDATA elements, leading to XSS, SOAP injection, or data manipulation.\n\nExisting CVEs for fast-xml-parser cover different issues:\n- CVE-2023-26920: Prototype pollution (parser)\n- CVE-2023-34104: ReDoS (parser)\n- CVE-2026-27942: Stack overflow in XMLBuilder with preserveOrder\n- CVE-2026-25896: Entity encoding bypass via regex in DOCTYPE entities\n\nThis finding covers **unescaped comment/CDATA delimiters in XMLBuilder** - a distinct vulnerability.\n\n## Vulnerable Code\n\n**File**: `src/fxb.js`\n\n```javascript\n// Line 442 - Comment building with NO escaping of -->\nbuildTextValNode(val, key, attrStr, level) {\n// ...\nif (key === this.options.commentPropName) {\nreturn this.indentate(level) + `\n` + this.newLine; // VULNERABLE\n}\n// ...\nif (key === this.options.cdataPropName) {\nreturn this.indentate(level) + `\n` + this.newLine; // VULNERABLE\n}\n}\n```\n\nCompare with attribute/text escaping which IS properly handled via `replaceEntitiesValue()`.\n\n## Proof of Concept\n\n### Test 1: Comment Injection (XSS in SVG/HTML context)\n\n```javascript\nimport { XMLBuilder } from 'fast-xml-parser';\n\nconst builder = new XMLBuilder({\ncommentPropName: \"#comment\",\nformat: true,\nsuppressEmptyNode: true\n});\n\nconst xml = {\nroot: {\n\"#comment\": \"-->\n\nlegitimate content\n\n```\n\n### Test 2: CDATA Injection (RSS feed)\n\n```javascript\nconst builder = new XMLBuilder({\ncdataPropName: \"#cdata\",\nformat: true,\nsuppressEmptyNode: true\n});\n\nconst rss = {\nrss: { channel: { item: {\ntitle: \"Article\",\ndescription: {\n\"#cdata\": \"Content]]>\n\nArticle\n\n```\n\n### Test 3: SOAP Message Injection\n\n```javascript\nconst builder = new XMLBuilder({\ncommentPropName: \"#comment\",\nformat: true\n});\n\nconst soap = {\n\"soap:Envelope\": {\n\"soap:Body\": {\n\"#comment\": \"Request from user: -->\ndeleteAll","url":"https://github.com/advisories/GHSA-gh4j-gqv2-49f6","published_at":"2026-04-22T20:04:17Z","updated_at":"2026-11-18T00:23:52Z","fetched_at":"2026-11-21T19:15:18.416841Z","severity":"critical","cvss_score":9.3,"epss":0.01152,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"fast-xml-parser","vuln_id":"CVE-2026-41650","vuln_ids":["CVE-2023-26920","CVE-2023-34104","CVE-2026-25896","CVE-2026-27942","CVE-2026-41650","GHSA-GH4J-GQV2-49F6"],"tags":["ghsa","npm","CWE-91"],"cluster_id":2323,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2445","html":"https://vulnwatch.ve1ve2.com/item/2445"}}]}