Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-21366
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:32 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-21366
Complete source record
{
"id": "eb4c97989d9b88ba9c494ff1f28c2d9d4ff826819b2c6a0019a06ede352ef810",
"url": "https://osv.dev/vulnerability/CVE-2021-21366",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-21366",
"summary": "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.",
"evidence": "osv:CVE-2021-21366",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-21366",
"aliases": [
"CVE-2021-21366",
"GHSA-h6q6-9hqw-rwfv"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/xmldom/xmldom",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "f763b002fb01d3e58010b04be35a3be50f9777e8"
},
{
"fixed": "d4201b9dfbf760049f457f9f08a3888d48835135"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:xmldom_project:xmldom:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "0.5.0"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "d4201b9dfbf760049f457f9f08a3888d48835135"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "f763b002fb01d3e58010b04be35a3be50f9777e8"
}
],
"source": "REFERENCES_TAG",
"original_tag": "0.5.0"
}
]
}
}
],
"versions": [
"0.4.0",
"0.3.0",
"0.2.1",
"0.2.0",
"v0.1.28-xmldom-alpha",
"v0.1.28-not-published",
"xmldom-aplha@v0.1.28",
"v0.1.27",
"0.1.27",
"0.1.26",
"0.1.25",
"0.1.24",
"0.1.23",
"0.1.22",
"0.1.21",
"0.1.20",
"0.1.19",
"0.1.18",
"0.1.17",
"0.1.2",
"0.1.1",
"0.1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21366.json"
}
}
],
"modified": "2026-10-20T10:54:28.526414078Z",
"provider": "osv",
"references": [
"https://www.npmjs.com/package/xmldom",
"https://github.com/xmldom/xmldom/releases/tag/0.5.0",
"https://github.com/xmldom/xmldom/security/advisories/GHSA-h6q6-9hqw-rwfv",
"https://lists.debian.org/debian-lts-announce/2023/01/msg00000.html",
"https://github.com/xmldom/xmldom/commit/d4201b9dfbf760049f457f9f08a3888d48835135"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*"
],
"vendor_product": "debian:debian_linux",
"extracted_events": [
{
"range": [
{
"introduced": "10.0"
},
{
"last_affected": "10.0"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2021-21366",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 385420,
"published_at": "2021-03-12T17:15:12.643+00:00"
}