CVE-2026-34601: xmldom XML Injection via Unsafe CDATA Serialization

xmldom Updated 01 Apr 2026

Summary

01/04/2026
No i
High
7.5

CVE-2026-34601: xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion. Affects xmldom versions < 0.6.0. No fix is published. 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

The xmldom package is a widely used library in the Node.js ecosystem that provides an implementation of the Document Object Model (DOM) for XML. It allows developers to create, manipulate, and serialize XML documents. However, a vulnerability exists in the way it handles CDATA sections, which can lead to XML injection attacks if untrusted user input is embedded within these sections.

Vulnerability Detail

The xmldom package allows attacker-controlled strings containing the CDATA terminator ']]>' to be inserted into a CDATASection node. During serialization, the XMLSerializer emits the CDATA content verbatim without rejecting or safely splitting the terminator. This oversight enables attackers to inject additional XML elements or attributes into the generated document, leading to potential integrity violations and business-logic manipulation. The vulnerability arises from the lack of validation in the createCDATASection method and unsafe serialization practices.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate patching is not possible, avoid using untrusted user input in CDATA sections. Instead, sanitize input before embedding it in XML documents. For example, you can replace ']]>' with a safe string:

const safeData = userInput.replace(/]]>/g, ']]]]><![CDATA[');
const cdata = doc.createCDATASection(safeData);

Conclusion

The xmldom package has a significant vulnerability that allows for XML injection through unsafe CDATA serialization. It is crucial for developers to update to the patched versions of the package or implement workarounds to mitigate the risk of exploitation. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the security of applications.

See every vulnerability recorded for xmldom →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring signup.

The vulnerability can lead to integrity violations of generated XML documents and business-logic injection, which may result in unauthorized actions or data manipulation.

Yes, the vulnerability affects versions of xmldom prior to 0.8.12 and @xmldom/xmldom prior to 0.9.9.

If you cannot update the package, ensure that any user input is sanitized before being included in CDATA sections to prevent injection attacks.

Related vulnerabilities

Recent vulnerabilities recorded for xmldom.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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