CVE-2026-83618
largeXML injection bypass in @xmldom/xmldom strict serializer (multiline regex)
In @xmldom/xmldom versions 0.9.10 through 0.9.11, the strict XMLSerializer (requireWellFormed: true) validates DocumentType.publicId and DocumentType.systemId using regular expressions that inherit the multiline flag, so a literal can pass validation based on its first line while line-break characters (U+000A, U+000D, U+2028, U+2029) or breakout markup remain embedded in the emitted <!DOCTYPE ...> declaration. An attacker triggers this by getting untrusted input into a DocumentType node's publicId or systemId — properties that are deliberately unvalidated at creation and direct assignment — and then having the application serialize the document in strict mode. The result is markup injection into the serialized XML output (CWE-91), defeating the strict-serialization mitigation intended to prevent DocumentType injection; per the CVSS 4.0 score the impact is confined to data integrity (VI:H), with no confidentiality or availability impact. Anyone on npm using @xmldom/xmldom 0.9.10 or 0.9.11 and serializing documents whose DOCTYPE identifiers can be influenced by untrusted input is affected; the flaw is fixed in 0.9.12. No public proof-of-concept is known, the issue is not in CISA KEV, and EPSS estimates only a 0.3% probability of exploitation within 30 days.
What to do: Upgrade @xmldom/xmldom to 0.9.12 or later. As an interim mitigation, strip line-break characters (U+000A, U+000D, U+2028, U+2029) and markup from DocumentType publicId/systemId values before serialization, or avoid enabling requireWellFormed: true for untrusted documents. Audit your dependency tree for pinned or locked 0.9.10/0.9.11 versions and confirm whether your code serializes attacker-influenced DOCTYPE identifiers.
| xmldom project @xmldom/xmldom (npm) | >= 0.9.10, < 0.9.12 (fixed in 0.9.12) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.10 until 0.9.12, the requireWellFormed: true serializer validates DocumentType.publicId and DocumentType.systemId with PubidLiteral_match and SystemLiteral_match expressions produced by reg() in lib/grammar.js, which inherit the multiline flag. A complete valid literal on the first line can therefore satisfy the matcher while U+000A, U+000D, U+2028, or U+2029 and breakout markup remain in the emitted declaration. This bypasses the strict-serialization mitigation for the earlier DocumentType injection advisory; creation and direct property assignment remain unvalidated by design. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Ecosystems
- npm
- Weakness
- CWE-91, CWE-625
- Vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- GHSA
- GHSA-vr34-hp96-76pp (high)
In the news0 stories
No ingested article mentions this CVE yet.