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 package | Versions | Reported by |
|---|---|---|
| xmldom xmldom | < 0.5.0 | CVE List |
| xmldom (npm) | before 0.5.0 | GitHub Advisory Database |
| xmldom_project xmldom | before 0.5.0 | NVD |
| debian debian_linux | 10.0 | NVD |
All scores
| GitHub_M | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
| GitHub | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
| NVD | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV: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). 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. Esto puede conllevar a cambios sintácticos inesperados durante el procesamiento de XML en algunas aplicaciones posteriores. Esto es corregido en la versión 0.5.0. Como solución alternativa, las aplicaciones posteriores pueden comprobar la entrada y rechazar los documentos diseñados maliciosos
References
| https://github.com/xmldom/xmldom/security/advisories/GHSA-h6q6-9hqw-rwfv | vendor-advisory, web | |
| https://www.npmjs.com/package/xmldom | product, web | |
| https://github.com/xmldom/xmldom/releases/tag/0.5.0 | release-notes, web | |
| https://github.com/xmldom/xmldom/commit/d4201b9dfbf760049f457f9f08a3888d48835135 | patch, web | |
| https://lists.debian.org/debian-lts-announce/2023/01/msg00000.html | mailing-list, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21366 | advisory | |
| https://github.com/xmldom/xmldom | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21366 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h6q6-9hqw-rwfv changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2021-21366 changed 2026-06-17 | Public domain |