<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Xmldom — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/xmldom/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 23 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/xmldom/feed.xml" rel="self" type="application/rss+xml"/><item><title>xmldom Uncontrolled Recursion DoS Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-04-xmldom-dos/</link><pubDate>Thu, 23 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-xmldom-dos/</guid><description>The xmldom library is vulnerable to a denial-of-service (DoS) attack due to uncontrolled recursion in XML serialization leading to application crashes.</description><content:encoded><![CDATA[<p>The <code>xmldom</code> library is susceptible to a denial-of-service (DoS) vulnerability due to uncontrolled recursion in XML serialization. Seven recursive traversals within <code>lib/dom.js</code> lack depth limits, causing a <code>RangeError: Maximum call stack size exceeded</code> and crashing the application when processing deeply nested XML documents. Publicly disclosed on 2026-04-06, the vulnerability impacts multiple functions, including <code>normalize()</code>, <code>XMLSerializer.serializeToString()</code>, and others related to DOM manipulation. This issue arises from the library&rsquo;s pure-JavaScript recursive implementation of DOM operations, which exhausts the call stack. Exploitation requires no authentication or special options, affecting applications that process attacker-controlled XML using vulnerable <code>xmldom</code> versions ( &lt; 0.8.13, &gt;= 0.9.0 and &lt; 0.9.10, and &lt;= 0.6.0).</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious XML document with deeply nested elements.</li>
<li>The vulnerable application receives and parses the crafted XML document using <code>DOMParser.parseFromString()</code>.</li>
<li>The application subsequently calls one of the affected DOM operations, such as <code>normalize()</code>, <code>serializeToString()</code>, <code>getElementsByTagName()</code>, or <code>cloneNode(true)</code>.</li>
<li>The affected function initiates a recursive traversal of the deeply nested XML structure within <code>lib/dom.js</code>.</li>
<li>Each level of nesting consumes a JavaScript call stack frame.</li>
<li>The recursive calls continue until the JavaScript engine&rsquo;s call stack is exhausted.</li>
<li>A <code>RangeError: Maximum call stack size exceeded</code> exception is thrown.</li>
<li>The application crashes due to the uncaught exception, leading to a denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in a denial-of-service condition. Any service parsing attacker-controlled XML with a vulnerable version of <code>xmldom</code> can be crashed by a single crafted payload. This can lead to 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. Tests show that stack exhaustion occurs with nesting depths between 5,000 and 10,000 levels depending on the operation.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>@xmldom/xmldom</code> to version &gt;= 0.8.13 or &gt;= 0.9.10 to remediate CVE-2026-41673.</li>
<li>If upgrading is not immediately feasible, consider implementing input validation to limit the nesting depth of XML documents processed by applications using <code>xmldom</code>.</li>
<li>Monitor application logs for <code>RangeError: Maximum call stack size exceeded</code> exceptions originating from <code>lib/dom.js</code>, which could indicate exploitation attempts.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>dos</category><category>xmldom</category><category>recursion</category><category>javascript</category></item><item><title>xmldom XML Node Injection via Comment Serialization</title><link>https://feed.craftedsignal.io/briefs/2024-01-26-xmldom-injection/</link><pubDate>Fri, 26 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-26-xmldom-injection/</guid><description>The xmldom library is vulnerable to XML node injection, allowing attackers to inject arbitrary XML nodes into serialized output by manipulating comment content; this is mitigated by using the `requireWellFormed` option in `serializeToString` after upgrading to version 0.8.13 or 0.9.10.</description><content:encoded><![CDATA[<p>The xmldom library is susceptible to XML node injection due to a lack of validation when serializing comment nodes. Versions prior to 0.8.13 and versions between 0.9.0 and 0.9.10 are vulnerable. An attacker can inject arbitrary XML nodes into the serialized output by including comment-breaking sequences (e.g., <code>--&gt;</code>) in the comment data. This allows them to alter the structure of the XML document. Exploitation involves crafting malicious input that leverages the library&rsquo;s DOM construction and serialization flow. It matters because applications using xmldom to process potentially untrusted XML data could be coerced into generating malicious XML structures. The fix requires an opt-in <code>requireWellFormed</code> flag to be enabled when calling <code>serializeToString()</code>.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An application receives untrusted data intended for use in XML comment content.</li>
<li>The application calls <code>createComment(data)</code> in xmldom, passing the untrusted data. The library stores the data without proper validation.</li>
<li>The application constructs an XML document, including the comment node created in the previous step.</li>
<li>The application calls <code>serializeToString()</code> on the XML document to serialize it.</li>
<li>If the untrusted data contains comment-breaking sequences, such as <code>--&gt;</code>, the serializer prematurely terminates the comment.</li>
<li>The serializer injects any subsequent content in the untrusted data as live XML markup.</li>
<li>The application stores, forwards, signs, or hands the serialized XML to another parser.</li>
<li>The downstream consumer trusts the altered XML structure, leading to unintended consequences, such as misconfiguration or security bypass.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows attackers to inject arbitrary XML nodes, potentially altering the structure and meaning of generated XML documents. This could lead to misconfiguration, policy bypass, or other security vulnerabilities in applications that rely on the integrity of the XML structure. The vulnerability affects applications that use xmldom to build XML from untrusted input. The number of victims depends on the usage of the vulnerable library and the exposure of applications to untrusted XML data.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>@xmldom/xmldom</code> version 0.8.13 or 0.9.10 or later to gain access to the fix.</li>
<li>Audit all calls to <code>serializeToString()</code> and add the <code>{ requireWellFormed: true }</code> option when serializing comments containing potentially untrusted data.</li>
<li>Implement server-side input validation to sanitize comment data by removing comment-breaking sequences like <code>--&gt;</code> before passing it to <code>createComment()</code>.</li>
<li>Deploy the Sigma rule to detect comment injections.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xml</category><category>injection</category><category>deserialization</category><category>vulnerability</category></item><item><title>xmldom XML Injection Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-xmldom-xml-injection/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-xmldom-xml-injection/</guid><description>The xmldom package is vulnerable to XML injection. The package serializes DocumentType node fields (internalSubset, publicId, systemId) verbatim without any escaping or validation. When these fields are set programmatically to attacker-controlled strings, XMLSerializer.serializeToString can produce output where the DOCTYPE declaration is terminated early and arbitrary markup appears outside it. To address this applications that pass untrusted data to createDocumentType() or write untrusted values directly to a DocumentType node's publicId, systemId, or internalSubset properties should audit all serializeToString() call sites and add the option.</description><content:encoded><![CDATA[<p>The <code>@xmldom/xmldom</code> and <code>xmldom</code> packages are vulnerable to XML injection due to the lack of validation when serializing <code>DocumentType</code> node fields. Specifically, the <code>internalSubset</code>, <code>publicId</code>, and <code>systemId</code> fields are serialized verbatim without any escaping or validation. This vulnerability affects <code>@xmldom/xmldom</code> versions prior to 0.8.13 and versions 0.9.0 to 0.9.9, as well as <code>xmldom</code> versions up to 0.6.0. The vulnerability is triggered when these fields are programmatically set to attacker-controlled strings, leading to potential arbitrary markup injection outside the DOCTYPE declaration during serialization using <code>XMLSerializer.serializeToString</code>. This can lead to downstream XML parsers being susceptible to XXE attacks. Defenders should audit serializeToString() call sites and add <code>{ requireWellFormed: true }</code> to mitigate this vulnerability.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies an application using a vulnerable version of <code>@xmldom/xmldom</code> or <code>xmldom</code>.</li>
<li>The attacker finds a code path where they can control the <code>publicId</code>, <code>systemId</code>, or <code>internalSubset</code> properties of a <code>DocumentType</code> node.</li>
<li>The attacker crafts a malicious string containing XML injection payloads (e.g., closing DOCTYPE tags or injecting SYSTEM entities).</li>
<li>The attacker uses programmatic calls to <code>createDocumentType</code> or direct property writes to set the malicious string as the value of the <code>publicId</code>, <code>systemId</code>, or <code>internalSubset</code> field.</li>
<li>The application calls <code>XMLSerializer.serializeToString</code> on the document, without the <code>{ requireWellFormed: true }</code> option.</li>
<li>The vulnerable serializer emits a DOCTYPE declaration where the injected malicious string is included verbatim, causing the DOCTYPE declaration to be terminated early or to include injected entities.</li>
<li>The serialized XML is passed to a downstream XML parser that performs entity expansion.</li>
<li>The downstream XML parser expands the injected entities, leading to potential XXE attacks, information disclosure, or other malicious actions.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can lead to the injection of arbitrary XML markup, potentially enabling XXE attacks against downstream XML parsers. The impact includes potential information disclosure, arbitrary code execution, or denial-of-service if the downstream parser expands external entities. This vulnerability impacts applications using vulnerable versions of <code>@xmldom/xmldom</code> and <code>xmldom</code> that construct <code>DocumentType</code> nodes from user-controlled data and serialize the document without proper validation.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>@xmldom/xmldom</code> version 0.8.13 or later, or version 0.9.10 or later, to receive the fix.</li>
<li>Upgrade to a version of <code>xmldom</code> greater than 0.6.0.</li>
<li>Audit all calls to <code>XMLSerializer.serializeToString()</code> and add the option <code>{ requireWellFormed: true }</code> to enforce validation of <code>DocumentType</code> node fields, as described in the advisory.</li>
<li>Applications that pass untrusted data to <code>createDocumentType()</code> or write untrusted values directly to a <code>DocumentType</code> node&rsquo;s <code>publicId</code>, <code>systemId</code>, or <code>internalSubset</code> properties should audit all <code>serializeToString()</code> call sites and add the option.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xml-injection</category><category>xxe</category><category>dom</category><category>xmldom</category></item></channel></rss>