CVE-2026-83618

xmldom: requireWellFormed DocType publicId/systemId validation is bypassable via an embedded line terminator

Published Sep 1, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
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 <!DOCTYPE ...> 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.

Analysis

AI-generated

Technical impact

The xmldom library, a pure JavaScript implementation of the W3C XML DOM Level 2 Core, failed to enforce strict well‑formedness checks on the DocumentType publicId and systemId fields between releases 0.9.10 and 0.9.12. It used multiline‑enabled regular expression literals, allowing an attacker to embed line terminators such as U+000A, U+000D, U+2028, or U+2029 into a publicId or systemId that passes the matcher yet still contains additional markup. This bypass enables a serialized <!DOCTYPE …> declaration to contain injected markup that can be interpreted by downstream consumers, potentially leading to DOM injection, cross‑site scripting, or other code execution attacks. The flaw is an example of improper input validation (CWE‑91) and an uncontrolled use of user input in serialization (CWE‑625).

Affected Systems

Any deployment relying on the xmldom npm package, specifically those using versions 0.9.10 or 0.9.11 (i.e., any release preceding 0.9.12). Users who upgraded to a version later than 0.9.12 are not affected by the described flaw.

Risk and Exploitability

The CVSS score is 8.7, indicating a high‑severity vulnerability. EPSS is currently unavailable, so the likelihood of exploitation is uncertain, but the absence of a KEV listing suggests no confirmed widespread exploitation as of now. The flaw is exploitable when an attacker can control or influence the XML input that is serialized, for example through an API that accepts user‑supplied XML. The attack vector is likely local or remote depending on how the xmldom instance is used, and the vulnerability requires the impacted library to perform serialization—an operation generally available to application developers or services ingesting XML. The validator’s misuse of multiline regexes constitutes a type of improper input validation (CWE‑91) that permits injection of malicious markup.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade xmldom to version 0.9.12 or later to apply the patched regex handling
  • Validate any XML payloads before parsing or serializing, rejecting malformed or unexpected DocumentType declarations
  • If possible, disable or neutralize external entity processing and other optional XML features that can be abused by attackers

Generated by OpenCVE AI on September 1, 2026 at 17:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-vr34-hp96-76pp xmldom: requireWellFormed DocType publicId/systemId validation is bypassable via an embedded line terminator
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

threat_severity

Important

Type Values Removed Values Added
First Time appeared Xmldom
Xmldom xmldom
Vendors & Products Xmldom
Xmldom xmldom
Type Values Removed Values Added
Description 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 <!DOCTYPE ...> 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.
Title xmldom: requireWellFormed DocType publicId/systemId validation is bypassable via an embedded line terminator
Weaknesses CWE-625
CWE-91
References
Metrics cvssV4_0

{'score': 8.7, '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'}

Weaknesses
  • CWE-625

    Permissive Regular Expression

  • CWE-91

    XML Injection (aka Blind XPath Injection)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 4, 2026, 1:59 AM
Reserved
Aug 31, 2026, 8:36 PM
Status
Deferred
Published
Sep 1, 2026, 3:17 PM
Modified
Sep 8, 2026, 9:11 PM
Severity
Important
Public date
Sep 1, 2026, 2:49 PM