{"vuln_id":"CVE-2023-34104","aliases":[],"description":"fast-xml-parser is an open source, pure javascript xml parser. fast-xml-parser allows special characters in entity names, which are not escaped or sanitized. Since the entity name is used for creating a regex for searching and replacing entities in the XML body, an attacker can abuse it for denial of service (DoS) attacks. By crafting an entity name that results in an intentionally bad performing regex and utilizing it in the entity replacement step of the parser, this can cause the parser to stall for an indefinite amount of time. This problem has been resolved in v4.2.4. Users are advised to upgrade. Users unable to upgrade should avoid using DOCTYPE parsing by setting the `processEntities: false` option.","published_at":"2023-06-06T18:15:11.643000Z","modified_at":"2026-06-17T06:02:54.207000Z","first_seen_at":"2026-11-21T19:15:20.158022Z","severity":"high","severity_source":"nvd","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-400","CWE-1333"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.01126,"epss_percentile":0.67131,"nvd_status":"Modified","enriched_at":"2026-11-22T13:36:53.132515Z","links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2023-34104"},"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"}}]}