Skip to main content

@xmldom/xmldom CVE-2026-41673

| EUVDEUVD-2026-28288 HIGH
Uncontrolled Recursion (CWE-674)
2026-04-22 https://github.com/xmldom/xmldom GHSA-2v35-w6hq-6mfw
8.7
CVSS 4.0 · Vendor: https://github.com/xmldom/xmldom
View

Attack ChainAIDerived

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

  1. Access
    Craft deeply nested XML payload
  2. Delivery
    Send HTTP request to vulnerable endpoint
  3. Exploit
    Application parses XML (succeeds)
  4. Execution
    Application calls normalize/serialize/query DOM
  5. Persist
    Recursive traversal exhausts call stack
  6. Impact
    RangeError crashes process

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
Exploitation Conditions

No special conditions - remote unauthenticated exploitation against default configurations of @xmldom/xmldom. Vulnerability triggers whenever application code (1) parses attacker-controlled XML using DOMParser.parseFromString or DOMImplementation.createDocument, creating a DOM tree, AND (2) subsequently invokes any of seven affected methods on the parsed tree: Node.prototype.normalize(), XMLSerializer.serializeToString(), Element.getElementsByTagName/NS/ClassName/Id(), Node.cloneNode(true), Document.importNode(node, true), node.textContent getter, or Node.isEqualNode(). Exploitation does NOT require malformed XML, parser errors, specific DOCTYPE declarations, or non-default library options. The SAX parser (lib/sax.js) successfully parses deeply nested documents, so attack payloads are valid well-formed XML. Limiting factors: Attack requires application code path that both accepts external XML input and performs at least one of the seven vulnerable DOM operations post-parse. Pure SAX-only workflows (streaming parse without DOM construction) are unaffected. Crash threshold varies by Node.js version and --stack-size configuration: default Node.js 18 exhibits 10,000-frame limit for six methods, 5,000-frame limit for serializeToString (due to per-frame visibleNamespaces.slice() allocation). Lower stack limits accelerate exploitation; higher limits require proportionally deeper nesting but do not prevent attack.

Impact

Real-world exploitation risk is HIGH despite no confirmed active exploitation or CISA KEV listing. CVSS 4.0 vector (AV:N/AC:L/PR:N/UI:N - network accessible, low complexity, no authentication, no user interaction) combined with availability impact VA:H indicates any internet-facing service parsing attacker-controlled XML is vulnerable. EPSS data not provided, but public GitHub advisory (GHSA-2v35-w6hq-6mfw), multiple researcher reports (praveen-kv, Jvr2022, KarimTantawey), and working proof-of-concept code published in advisory substantially increase weaponization likelihood. Attack prerequisites are minimal: a single HTTP POST with 5KB-50KB of valid deeply-nested XML (10,000 '<a>' tags) triggers immediate crash on any of seven common DOM operations. CVSS scores denial-of-service-only impact, but uncaught RangeError in async Node.js contexts (callbacks, promise chains) can terminate the entire process rather than failing a single request - documented in advisory technical details. SSVC decision factors: Exploitation=poc (public code exists), Automatable=yes (no human interaction needed post-deployment), Technical Impact=partial (availability only). Widespread deployment in Node.js XML processing pipelines (RSS parsers, SOAP clients, configuration file handlers) creates broad attack surface. Patch availability in maintained branches (0.8.13, 0.9.10) reduces risk for current users, but legacy xmldom package (abandoned, 500K+ weekly downloads per historical NPM data) and delayed upgrade cycles keep large installed base exploitable. No conflicting signals detected - all data sources (CVSS, CWE, GitHub advisory, commit evidence) align on confirmed DoS vulnerability with available fix.

Exploit ScenarioDerived

Attacker sends HTTP POST request containing 10KB XML document with 10,000 nested <element> tags to a Node.js API endpoint using @xmldom/xmldom for request body parsing. Application successfully parses XML via DOMParser.parseFromString (iterative SAX parser), then calls normalize() or XMLSerializer.serializeToString() on resulting DOM tree to validate or transform content. Recursive traversal exhausts V8 call stack at ~5,000-10,000 frames, throwing uncaught RangeError that terminates request handler. In single-threaded Node.js process without cluster mode or PM2, uncaught exception crashes entire application, requiring manual restart and denying service to all concurrent users. Public proof-of-concept code exists in GitHub advisory GHSA-2v35-w6hq-6mfw demonstrating both normalize and serializeToString attack vectors.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – May 07, 2026

Denial of service in @xmldom/xmldom Node.js XML library allows remote attackers to crash applications via deeply nested XML documents. Seven DOM traversal methods (normalize, serializeToString, getElementsByTagName, cloneNode, importNode, textContent getter, isEqualNode) implement unbounded recursion consuming call stack frames until RangeError exception terminates the process. Exploitation requires no authentication - attackers send a single valid XML payload nested ~5,000-10,000 levels deep to trigger stack exhaustion in any subsequent DOM operation. Browser implementations of identical DOM methods use iterative C++ code and are unaffected. CVSS 8.7 High severity reflects network attack vector with no complexity barriers. Vendor-released patches (0.8.13, 0.9.10) replace all recursive traversals with iterative 'walkDOM' utility consuming heap instead of stack. Legacy unscoped 'xmldom' package (≤0.6.0) remains unfixed.

Earlier versions of this analysis (1)
v1 Apr 23, 2026 - 06:51

Denial-of-service crashes occur in xmldom (both @xmldom/xmldom and legacy xmldom packages) when seven different DOM operations encounter deeply nested XML trees. Remote attackers can crash Node.js applications by sending valid XML with ~5,000-10,000 nested elements, then triggering operations like normalize(), serializeToString(), getElementsByTagName(), cloneNode(true), importNode(), textContent getter, or isEqualNode(). The vulnerability stems from unbounded recursive traversals in pure-JavaScript implementations that exhaust the call stack with RangeError exceptions. Multiple researchers independently reported different attack vectors (normalize via @praveen-kv and @KarimTantawey, serializeToString via @Jvr2022), with the vendor discovering five additional vulnerable entry points during remediation research. Patches converting all recursive traversals to iterative heap-based implementations are available in releases 0.8.13 and 0.9.10.

RemediationAI

Upgrade to patched versions: @xmldom/xmldom 0.8.13 or later for 0.8.x users, or 0.9.10 or later for 0.9.x users, available from https://github.com/xmldom/xmldom/releases/tag/0.8.13 and https://github.com/xmldom/xmldom/releases/tag/0.9.10. Ten GitHub commits (17678a2, 291257, 2d6d691, 430357c, 4845ef1, 8834218, 8b7cfd1, b062038, e6edcab listed in advisory references) collectively rewrite all seven recursive traversals as iterative implementations using a new walkDOM utility function that maintains an explicit JavaScript array stack instead of consuming call frames, eliminating depth limits. For environments unable to immediately upgrade, implement XML depth validation before parsing: reject documents where maximum element nesting exceeds 1,000 levels using a streaming pre-parse check or SAX parser with depth counter (note: @xmldom/xmldom's own SAX parser does not expose depth to applications, requiring external validation). Compensating control trade-off: depth limits below 1,000 may break legitimate deeply-nested documents in specialized domains (academic XML corpora, auto-generated config files). Do NOT rely on try-catch wrappers around DOM operations - RangeError at stack exhaustion may not be catchable in async code paths and catch handlers themselves require stack frames. For legacy xmldom users (≤0.6.0) with no patch available: migrate to @xmldom/xmldom 0.8.13+ or replace with alternative maintained libraries (jsdom, libxmljs2) that use native/iterative DOM implementations. Container-level mitigation: configure Node.js --stack-size parameter to crash earlier with smaller payloads, providing faster failure detection but not preventing DoS.

Affected VersionsENISA

xmldom xmldom ≤ 0.6.0
xmldom @xmldom/xmldom < 0.8.13
xmldom @xmldom/xmldom 0.9.0, < 0.9.10

Affected Packages

npm @xmldom/xmldom fix: 0.8.13, 0.9.10
npm xmldom no fix
euvd xmldom_xmldom no fix
euvd xmldom_xmldom_xmldom fix: 0.8.13, 0.9.10

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 4 packages in npm, euvd

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

Technical ContextAI · show details

@xmldom/xmldom is a pure-JavaScript implementation of W3C DOM Level 2 Core for Node.js environments, providing XML parsing and manipulation when native browser DOM APIs are unavailable. The library consists of two components: an iterative SAX parser (lib/sax.js) that successfully parses arbitrarily deep XML without stack consumption, and DOM tree manipulation functions (lib/dom.js) implemented as depth-first recursive functions. Each level of XML nesting adds one JavaScript call frame; V8's default stack limit (~10,000-13,000 frames in Node.js 18) creates a hard ceiling. CWE-674 (Uncontrolled Recursion) is the root cause - seven distinct tree-walking functions (normalize, serializeToString via internal worker, _visitNode helper used by four getElementsBy* variants, cloneNode/importNode module functions, getTextContent, isEqualNode) lack depth guards or iterative fallback logic. The vulnerability manifests only in JavaScript execution contexts; Chromium's native C++ DOM implementations of identical methods (tested at 20,000+ depth) traverse iteratively. CPE data identifies three affected package namespaces: scoped @xmldom/xmldom (primary, actively maintained), legacy unscoped xmldom (abandoned ≤0.6.0), and NPM ecosystem exposure through transitive dependencies in projects consuming either namespace.

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/xmldom/xmldom) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 7.5 HIGH

Primary rating from Vendor (https://github.com/xmldom/xmldom).

CVSS VectorVendor: https://github.com/xmldom/xmldom

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

4
Analysis Updated
May 07, 2026 - 04:47 vuln.today
v2 - CVSS changed
CVSS changed
May 07, 2026 - 04:35 NVD
8.7 (HIGH)
Patch released
Apr 22, 2026 - 20:31 nvd
Patch available
CVE Published
Apr 22, 2026 - 20:23 nvd
HIGH

DescriptionCVE.org

Summary

Seven recursive traversals in lib/dom.js operate without a depth limit. A sufficiently deeply nested DOM tree causes a RangeError: Maximum call stack size exceeded, crashing the application.

Reported operations:

  • Node.prototype.normalize() - reported by @praveen-kv (email 2026-04-05) and @KarimTantawey (GHSA-fwmp-8wwc-qhv6, via DOMParser.parseFromString())
  • XMLSerializer.serializeToString() - reported by @Jvr2022 (GHSA-2v35-w6hq-6mfw) and @KarimTantawey (GHSA-j2hf-fqwf-rrjf)

Additionally, discovered in research:

  • Element.getElementsByTagName() / getElementsByTagNameNS() / getElementsByClassName() / getElementById()
  • Node.cloneNode(true)
  • Document.importNode(node, true)
  • node.textContent (getter)
  • Node.isEqualNode(other)

All seven share the same root cause: pure-JavaScript recursive tree traversal with no depth guard. A single deeply nested document (parsed successfully) triggers any or all of these operations.

---

Details

Root cause

lib/dom.js implements DOM tree traversals as depth-first recursive functions. Each level of element nesting adds one JavaScript call frame. The JS engine's call stack is finite; once exhausted, a RangeError: Maximum call stack size exceeded is thrown. This error may not be caught reliably at stack-exhaustion depths because the catch handler itself requires stack frames to execute - especially in async scenarios, where an uncaught RangeError inside a callback or promise chain can crash the entire Node.js process.

Parsing a deeply nested document succeeds - the SAX parser in lib/sax.js is iterative. The crash occurs during subsequent operations on the parsed DOM.

Node.prototype.normalize() - reported by @praveen-kv

lib/dom.js:1296-1308 (main):

js
normalize: function () {
    var child = this.firstChild;
    while (child) {
        var next = child.nextSibling;
        if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {
            this.removeChild(next);
            child.appendData(next.data);
        } else {
            child.normalize();   // recursive call - no depth guard
            child = next;
        }
    }
},

Crash threshold (Node.js 18, default stack): ~10,000 levels.

XMLSerializer.serializeToString() - reported by @Jvr2022

lib/dom.js:2790-2974 (main): The internal serializeToString worker recurses into child nodes at four call sites, each passing a visibleNamespaces.slice() copy. The per-frame allocation causes earlier stack exhaustion than normalize().

Crash threshold (Node.js 18, default stack): ~5,000 levels.

Additional recursive entry points

All five crash at ~10,000 levels on Node.js 18.

FunctionDefinitionPublic API entry point(s)Crash depth (Node.js 18)
_visitNodelib/dom.js:1529getElementsByTagName(), getElementsByTagNameNS(), getElementsByClassName(), getElementById()~10,000 levels
cloneNode (module fn)lib/dom.js:3037Node.prototype.cloneNode(true)~10,000 levels
importNode (module fn)lib/dom.js:2975Document.prototype.importNode(node, true)~10,000 levels
getTextContent (inner fn)lib/dom.js:3130node.textContent (getter)~10,000 levels
isEqualNodelib/dom.js:1120Node.prototype.isEqualNode(other)~10,000 levels

Both active branches (main and release-0.8.x) are identically affected. The unscoped xmldom package (≤ 0.6.0) carries the same recursive patterns from its initial commit.

Browser behavior

Tested with Chromium 147 (Playwright headless). Chromium's native C++ implementations of all seven DOM methods are iterative - they traverse the DOM without consuming JS call stack frames. All seven succeed at depths up to 20,000 without any crash.

When @xmldom/xmldom is bundled and run in a browser context the same recursive JS code executes under the browser's V8 stack limit (~12,000-13,000 frames). The crash thresholds are similar to those observed on Node.js 18 (~5,000 for serializeToString, ~10,000 for the remaining six).

The vulnerability is specific to xmldom's pure-JavaScript recursive implementation, not an inherent property of the DOM operations.

---

PoC

normalize() (from @praveen-kv report, 2026-04-05)

js
const { DOMParser } = require('@xmldom/xmldom');

function generateNestedXML(depth) {
    return '<root>' + '<a>'.repeat(depth) + 'text' + '</a>'.repeat(depth) + '</root>';
}

const doc = new DOMParser().parseFromString(generateNestedXML(10000), 'text/xml');
doc.documentElement.normalize();
// RangeError: Maximum call stack size exceeded

XMLSerializer.serializeToString() (from GHSA-2v35-w6hq-6mfw)

js
const { DOMParser, XMLSerializer } = require('@xmldom/xmldom');

const depth = 5000;
const xml = '<a>'.repeat(depth) + '</a>'.repeat(depth);
const doc = new DOMParser().parseFromString(xml, 'text/xml');
new XMLSerializer().serializeToString(doc);
// RangeError: Maximum call stack size exceeded

The other methods have been verified using similar pocs.

---

Impact

Any service that accepts attacker-controlled XML and subsequently calls any of the seven affected DOM operations can be forced into a reliable denial of service with a single crafted payload.

The immediate result is an uncaught RangeError and failed request processing. In deployments where uncaught exceptions terminate the worker or process, the impact can extend beyond a single request and disrupt service availability more broadly.

No authentication, special options, or invalid XML is required. A valid, deeply nested XML document is enough.

---

Disclosure

The normalize() vector was publicly disclosed at 2026-04-06T11:25:07Z via xmldom/xmldom#987 (closed without merge). serializeToString() and the five additional recursive entry points were not mentioned in that PR.

---

Fix Applied

All seven affected traversals have been converted from recursive to iterative implementations, eliminating call-stack consumption on deep trees.

walkDOM utility

A new walkDOM(node, context, callbacks) utility is introduced. It traverses the subtree rooted at node in depth-first order using an explicit JavaScript array as a stack, consuming heap memory instead of call-stack frames. context is an arbitrary value threaded through the walk - each callbacks.enter(node, context) call returns the context to pass to that node's children, enabling per-branch state (e.g. namespace snapshots in the serializer). callbacks.exit(node, context) (optional) is called in post-order after all children have been visited.

The following six operations are re-implemented on top of walkDOM:

OperationPublic entry point(s)
_visitNode helpergetElementsByTagName(), getElementsByTagNameNS(), getElementsByClassName(), getElementById()
getTextContent inner functionnode.textContent getter
cloneNode module functionNode.prototype.cloneNode(true)
importNode module functionDocument.prototype.importNode(node, true)
serializeToString workerXMLSerializer.prototype.serializeToString(), Node.prototype.toString(), NodeList.prototype.toString()
normalizeNode.prototype.normalize()

normalize uses walkDOM with a null context and an enter callback that merges adjacent Text children of the current node before walkDOM reads and queues those children - so the surviving post-merge children are what the walker descends into.

Custom iterative loop for isEqualNode

One function cannot use walkDOM:

Node.prototype.isEqualNode(other) (0.9.x only; absent from 0.8.x) compares two trees in parallel. It maintains an explicit stack of {node, other} node pairs - one node from each tree - which cannot be expressed with walkDOM's single-tree visitor.

After the fix

All seven entry points succeed on trees of arbitrary depth without throwing RangeError. The original PoCs still demonstrate the vulnerability on unpatched versions and confirm the fix on patched versions.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4 npm packages depend on @xmldom/xmldom (4 direct, 0 indirect)
  • 2,019 npm packages depend on xmldom (864 direct, 1,181 indirect)

Ecosystem-wide dependent count for version 0.9.0 and other introduced versions.

Executive ViewAI

Why It Matters

The @xmldom/xmldom Node.js library contains a denial-of-service vulnerability (CVE-2026-41673, CVSS 8.7) allowing remote attackers to crash any application processing XML documents by sending deeply nested payloads without authentication. Organizations using this library in production APIs, web services, or XML processing pipelines face immediate risk of service disruption; a single malicious request can terminate the application process.

Business Impact: High
Compensating Controls

Apply vendor patch (versions 0.8.13 or 0.9.10). If immediate patching is not feasible: (1) Implement XML payload depth limits and maximum nesting level validation before DOM parsing; (2) Configure rate limiting and request timeouts on XML processing endpoints; (3) Isolate XML processing into separate worker processes with automatic restart capability to limit blast radius; (4) Monitor application logs for RangeError exceptions and stack exhaustion patterns.

Threat Intelligence Overview

EPSS Score
0.1%
Top 76% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High

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 HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Yes
Human Impact
High

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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: High
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Python 3 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed
SUSE Linux Enterprise Server for SAP Applications 15 SP7 Fixed

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