CVE-2022-39353CWE-1288CWE-20

xmldom allows multiple root nodes in a DOM

Critical · published November 2, 2022

CVSS v3.1
9.4
EPSS
1%
Percentile
69.8
In the wild
Unconfirmed
What it is

🔥 The xmldom library can mismanage your XML like a restaurant that serves multiple orders on the same plate — and it’s causing some serious confusion! Imagine you're at a fancy restaurant, and the chef accidentally throws all the ingredients for different dishes onto one plate without regard for what's supposed to go where. This is how xmldom processes XML: it accepts multiple top-level elements without raising any alarms, leading to a chaotic dining experience! This critical flaw allows attackers to exploit the misunderstanding of the XML structure, potentially leading to unexpected behaviors or vulnerabilities in applications relying on correct XML parsing. If a malicious actor gets hold of your XML data, they could manipulate it into a format that causes your application to misbehave, leading to anything from data leaks to application crashes!

Put simply

Imagine you're at a fancy restaurant, and the chef accidentally throws all the ingredients for different dishes onto one plate without regard for what's supposed to go where. This is how xmldom processes XML: it accepts multiple top-level elements without raising any alarms, leading to a chaotic dining experience! CVE-2022-39353 highlights a flaw in the xmldom library, where it fails to enforce the rule of a single root node in XML documents. By allowing multiple root nodes, it breaks assumptions about the document structure, which can have downstream effects on dependent systems.

What to do

This critical flaw allows attackers to exploit the misunderstanding of the XML structure, potentially leading to unexpected behaviors or vulnerabilities in applications relying on correct XML parsing. If a malicious actor gets hold of your XML data, they could manipulate it into a format that causes your application to misbehave, leading to anything from data leaks to application crashes! To protect your applications, update xmldom to the latest version: @xmldom/xmldom@~0.7.7, @xmldom/xmldom@~0.8.4, or @xmldom/xmldom@>=0.9.0-beta.4. If an immediate update isn't feasible, consider only searching for elements within the `documentElement`, or reject documents that contain more than one `childNode`. You’ve got this! By taking these steps, you'll keep your XML parsing safe and sound! 🛡️

The record
Technical detail
CVSS v3.1
9.4 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01279 · 69.8th percentile
Weaknesses
CWE-1288 · Improper Validation of Consistency within Input; CWE-20 · Improper Input Validation
Published
2022-11-02T00:00Z
EPSS history
Timeline
  • 02 NOV 00:00Z
    xmldom allows multiple root nodes in a DOM
    cvelistv5