CVE-2022-39353
JavaScript vulnerability analysis and mitigation

Overview

xmldom, a pure JavaScript W3C standard-based DOMParser and XMLSerializer module, was found to contain a vulnerability identified as CVE-2022-39353. The vulnerability was discovered in October 2022 and affects versions <0.7.7, >=0.8.0 <0.8.4, and >=0.9.0-beta.1 <0.9.0-beta.4. The issue allows parsing of malformed XML documents containing multiple top-level elements without reporting any errors (GitHub Advisory).

Technical details

The vulnerability stems from xmldom's behavior of parsing XML that contains multiple top-level elements and adding all root nodes to the childNodes collection of the Document without reporting any error or throwing an exception. This breaks the fundamental XML specification requirement that mandates only a single root node in the document tree. The issue was rated as Critical severity and is associated with CWE-20 (Improper Input Validation) and CWE-1288 weaknesses (GitHub Advisory).

Impact

This vulnerability breaks the critical assumption that there should only be a single root node in the XML tree. This violation of XML specifications can lead to security holes in downstream applications, as demonstrated by its connection to CVE-2022-39299. The issue could potentially result in unexpected behavior in applications that rely on proper XML document structure (GitHub Advisory).

Mitigation and workarounds

Users are advised to update to patched versions: @xmldom/xmldom@~0.7.7, @xmldom/xmldom@~0.8.4, or @xmldom/xmldom@>=0.9.0-beta.4. Alternative workarounds include searching for elements only in the documentElement instead of the whole DOM, or implementing validation to reject documents with more than one childNode (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-55182CRITICAL10
  • JavaScriptJavaScript
  • react-server-dom-webpack
NoYesDec 03, 2025
CVE-2025-66032HIGH8.7
  • JavaScriptJavaScript
  • @anthropic-ai/claude-code
NoYesDec 03, 2025
CVE-2025-66412HIGH8.5
  • JavaScriptJavaScript
  • @angular/compiler
NoYesDec 01, 2025
CVE-2025-66415MEDIUM6.9
  • JavaScriptJavaScript
  • @fastify/reply-from
NoYesDec 01, 2025
CVE-2025-66404MEDIUM6.4
  • JavaScriptJavaScript
  • mcp-server-kubernetes
NoYesDec 03, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management