CVE-2022-39353

CVE-2022-39353 is a critical-severity improper input validation vulnerability in xmldom (npm), affecting versions <= 0.6.0. It is fixed in 0.7.7, 0.8.4, 0.9.0-beta.4.

Summary

Workarounds

One of the following approaches might help, depending on your use case:

  • Instead of searching for elements in the whole DOM, only search in the documentElement.
  • Reject a document with a document that has more then 1 childNode.

References

For more information

If you have any questions or comments about this advisory:

Impact

xmldom parses XML that is not well-formed because it contains multiple top level elements, and adds all root nodes to the childNodes collection of the Document, without reporting any error or throwing.
This breaks the assumption that there is only a single root node in the tree, which led to https://nvd.nist.gov/vuln/detail/CVE-2022-39299 and is a potential issue for dependents.

The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.

CVE-2022-39353 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.7.7, 0.8.4, 0.9.0-beta.4); upgrading removes the vulnerable code path.

Affected versions

xmldom (<= 0.6.0) @xmldom/xmldom (< 0.7.7) @xmldom/xmldom (>= 0.8.0, < 0.8.4) @xmldom/xmldom (>= 0.9.0-beta.1, < 0.9.0-beta.4)

Security releases

@xmldom/xmldom → 0.7.7 (npm) @xmldom/xmldom → 0.8.4 (npm) @xmldom/xmldom → 0.9.0-beta.4 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Update to @xmldom/xmldom@~0.7.7, @xmldom/xmldom@~0.8.4 (dist-tag latest) or @xmldom/xmldom@>=0.9.0-beta.4 (dist-tag next).

Frequently Asked Questions

  1. What is CVE-2022-39353? CVE-2022-39353 is a critical-severity improper input validation vulnerability in xmldom (npm), affecting versions <= 0.6.0. It is fixed in 0.7.7, 0.8.4, 0.9.0-beta.4. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.
  2. How severe is CVE-2022-39353? CVE-2022-39353 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2022-39353?
    • xmldom (npm) (versions <= 0.6.0)
    • @xmldom/xmldom (npm) (versions < 0.7.7)
  4. Is there a fix for CVE-2022-39353? Yes. CVE-2022-39353 is fixed in 0.7.7, 0.8.4, 0.9.0-beta.4. Upgrade to this version or later.
  5. Is CVE-2022-39353 exploitable, and should I be worried? Whether CVE-2022-39353 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2022-39353 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2022-39353?
    • Upgrade @xmldom/xmldom to 0.7.7 or later
    • Upgrade @xmldom/xmldom to 0.8.4 or later
    • Upgrade @xmldom/xmldom to 0.9.0-beta.4 or later

Other vulnerabilities in xmldom

CVE-2026-41673CVE-2026-41674CVE-2026-41675CVE-2026-41672CVE-2022-39353

Stop the waste.
Protect your environment with Kodem.