CVE-2021-21366
JSON

4.3medium

Misinterpretation of malicious XML input

Severity
4.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.34% (higher than 72% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-h6q6-9hqw-rwfv

Description

xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. xmldom versions 0.4.0 and older do not correctly preserve system identifiers, FPIs or namespaces when repeatedly parsing and serializing maliciously crafted documents. This may lead to unexpected syntactic changes during XML processing in some downstream applications. This is fixed in version 0.5.0. As a workaround downstream applications can validate the input and reject the maliciously crafted documents.

Affected

Product or packageVersionsReported by
xmldom xmldom< 0.5.0CVE List
xmldom (npm)before 0.5.0GitHub Advisory Database
xmldom_project xmldombefore 0.5.0NVD
debian debian_linux10.0NVD

All scores

GitHub_M4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
GitHub4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
NVD4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:N/I:P/A:N

Classification

What each source says

CVE List

xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. xmldom versions 0.4.0 and older do not correctly preserve system identifiers, FPIs or namespaces when repeatedly parsing and serializing maliciously crafted documents. This may lead to unexpected syntactic changes during XML processing in some downstream applications. This is fixed in version 0.5.0. As a workaround downstream applications can validate the input and reject the maliciously crafted documents.

GitHub Advisory Database
Impact

xmldom versions 0.4.0 and older do not correctly preserve system identifiers, FPIs or namespaces when repeatedly parsing and serializing maliciously crafted documents.

This may lead to unexpected syntactic changes during XML processing in some downstream applications.

Patches

Update to 0.5.0 (once it is released)

Workarounds

Downstream applications can validate the input and reject the maliciously crafted documents.

References

Similar to this one reported on the Go standard library:

For more information

If you have any questions or comments about this advisory:

  • Open an issue in xmldom/xmldom
  • Email us: send an email to all addresses that are shown by npm owner ls xmldom
NVD (es)

xmldom es un módulo DOMParser y XMLSerializer basado en el estándar JavaScript W3C puro (XML DOM Level 2 Core).&#xa0;xmldom versiones 0.4.0 y anteriores, no preservan correctamente los identificadores del sistema, los FPI o los espacios de nombres cuando se analizan y serializan repetidamente documentos diseñados maliciosos.&#xa0;Esto puede conllevar a cambios sintácticos inesperados durante el procesamiento de XML en algunas aplicaciones posteriores.&#xa0;Esto es corregido en la versión 0.5.0.&#xa0;Como solución alternativa, las aplicaciones posteriores pueden comprobar la entrada y rechazar los documentos diseñados maliciosos

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21366 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-h6q6-9hqw-rwfv changed 2026-09-10CC-BY-4.0
NVDCVE-2021-21366 changed 2026-06-17Public domain