CVE-2026-41650: fast-xml-parser XMLBuilder Comment and CDATA Injection Vulnerability

fast-xml-parser Updated 22 Apr 2026

Summary

22/04/2026
Yes i
Moderate
6.1

CVE-2026-41650: fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters. Affects fast-xml-parser versions < 5.7.0. Fixed in 5.7.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

fast-xml-parser is a popular JavaScript library used for parsing and building XML from JavaScript objects. It provides features like XML validation, customizable options for XML generation, and support for comments and CDATA sections. However, it has a vulnerability in its XMLBuilder component that allows for XML injection through unescaped delimiters in comments and CDATA sections.

Vulnerability Detail

The vulnerability arises from the fact that fast-xml-parser's XMLBuilder does not escape the --> sequence in comments or the ]]> sequence in CDATA sections when generating XML. This oversight can lead to XML injection attacks, allowing an attacker to inject malicious scripts or modify the structure of SOAP messages and RSS feeds. The potential ramifications include Cross-Site Scripting (XSS), SOAP injection, and data manipulation, making it a serious concern for applications that utilize user-controlled data in XML comments or CDATA.

How To Fix

Latest published version: 5.11.2 as of 23 Oct 2026

npm install fast-xml-parser@5.11.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.7.0

This is the first release that contains the fix.

npm install fast-xml-parser@5.7.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you cannot update the package immediately, you can implement a workaround by manually escaping the delimiters in your data before passing it to the XMLBuilder. For comments, replace '--' with '--'. For CDATA, split on ']]>' and rejoin with separate CDATA sections. Here is an example of how to do this:

const safeComment = userComment.replace(/--/g, '&#45;&#45;');
const safeCdata = userCdata.replace(/]]>/g, ']]]]><![CDATA[>');

Conclusion

The fast-xml-parser library has a significant vulnerability (CVE-2026-41650) that allows for XML injection through unescaped delimiters in comments and CDATA sections. It is crucial to update to the patched version or implement workarounds to mitigate the risks associated with this vulnerability.

See every vulnerability recorded for fast-xml-parser →

Share this vulnerability

FAQ

CVE-2026-41650 is a vulnerability in the fast-xml-parser library that allows for XML injection through unescaped delimiters in comments and CDATA sections.

The vulnerability can lead to XSS attacks, SOAP message manipulation, and data poisoning in RSS feeds, posing significant security risks.

You can use Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without any signup.

Update the fast-xml-parser package to version 5.7.0 or later by running 'npm install fast-xml-parser@5.7.0' in your project directory.

Implement a workaround by manually escaping the delimiters in your data before passing it to the XMLBuilder.

Related vulnerabilities

Recent vulnerabilities recorded for fast-xml-parser.

How To Fix

Latest published version: 5.11.2 as of 23 Oct 2026

npm install fast-xml-parser@5.11.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.7.0

This is the first release that contains the fix.

npm install fast-xml-parser@5.7.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback