CVE-2026-83618
Summary
An embedded line terminator bypasses the requireWellFormed serializer check for a DocumentType's
publicId and systemId. The check was added to fix GHSA-f6ww-3ggp-fr8h; an id whose first line is a
valid literal slips past it and is emitted verbatim into the <!DOCTYPE …> declaration, so the markup
after the line terminator breaks out into the surrounding document. Callers who enabled
requireWellFormed to neutralize DocumentType injection remain exposed.
Details
publicId and systemId are stored as raw values including their surrounding quotes, and the
PubidLiteral/SystemLiteral productions include those quotes. The serializer validates them with
g.PubidLiteral_match.test(publicId) and g.SystemLiteral_match.test(systemId), where both matchers
are reg('^', …, '$') and inherit the m flag from xmldom's shared regexp builder. Under m, $
matches at an interior line terminator, so a value such as "valid pubid"\n"><!ENTITY …> satisfies
the matcher on its first line ("valid pubid" is a complete PubidLiteral) and the whole value —
including the post-newline breakout — is emitted after PUBLIC/SYSTEM.
Root Cause
1. A shared regexp builder compiles anchored productions with the m flag.
2. ^…$ under m are line anchors, not string anchors.
3. A full-string validator built on such a production (.test()) accepts any string with one
conforming line, so a complete, valid literal on the first line passes even though a line terminator
and breakout markup follow. PubidChar excluding </> does not prevent it — the breakout is
appended *after* the literal, not embedded inside it.
The triggering line terminators are the ECMAScript LineTerminator set: U+000A, U+000D, U+2028, U+2029.
Affected Versions
Only @xmldom/xmldom 0.9.x is affected. The vulnerable matchers are built by lib/grammar.js's
m-flagged reg() builder, and the DocType publicId/systemId requireWellFormed check that
consumes them was introduced in 0.9.10 (the GHSA-f6ww-3ggp-fr8h fix); 0.9.10 and 0.9.11 carry it.
0.8.x
⚡ Watch CVE-2026-83618
Get an email if CVE-2026-83618 is added to CISA KEV, gains public exploit code, or a new advisory cites it — max one per day, one-click unsubscribe.
Exploitation outlook
- Low exploitation risk0.33% 30-day exploitation probability — currently an unlikely target, but scores change as exploit code circulates. Riskier than 25% of all EPSS-scored CVEs.
Advisory coverage (2)
External references
Embed the live status
— this badge updates automatically when the KEV or exploit status changes. How to embed it →
[](https://www.csirts.com/cve/CVE-2026-83618)