Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

GHSA-6h8r-xr42-gp59

Fix: xmldom/xmldom#1071

GHSA-6h8r-xr42-gp59 is a CWE-1286 vulnerability in @xmldom/xmldom. O3 Security confirms whether GHSA-6h8r-xr42-gp59 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

xmldom: Parser silently accepts a not-well-formed end tag whose name is followed by a line break and trailing content

Also known asCVE-2026-83611
Published
Sep 8, 2026
Updated
Sep 8, 2026
Affected
3 pkgs
Patched
2 / 3
Exploits
None indexed
Exploitation data as of Sep 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.

Exploitation and automatability from CISA’s SSVC triage for GHSA-6h8r-xr42-gp59.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs28th percentile — riskier than 28% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Real-World Exposure

3 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

1Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@xmldom/xmldomnpm
28.0Mdownloads / week
xmldomnpm
805Kdownloads / week

Description

Summary

xmldom's parser silently accepts a not-well-formed end tag whose valid name is followed by trailing content — e.g. </a⏎junk>. The element is closed, the trailing content is discarded, and no error is reported, even though the XML end-tag production allows only optional whitespace after the name and both Chromium and Firefox reject such input as application/xml. An application that relies on xmldom to reject not-well-formed input therefore receives a false "valid" result for a document the specification and browsers consider malformed.

Details

Across every affected version, an end tag whose valid Name is followed by trailing content before > is silently accepted: the element is closed, the residue is dropped, and no error is reported. How much leaks differs by line (see Affected Versions), but the observable weakness is the same.

On the current (0.9.x) line, the parser validates the end-tag name against the XML ETag production with an anchored regular expression (^ QName S? $). That expression is compiled with the m (multiline) flag by a shared builder, so $ matches at an interior line terminator: a valid name on the first line satisfies the anchored production and any content after the line break escapes the check. On 0.9.x the whitespace-separated variant (</a junk>) is already rejected; only the line-terminator variant leaks. Older lines have no anchored end-tag validator at all, so they accept both the line-terminator and the whitespace variant.

This is not content injection — the trailing content is dropped, and the resulting DOM is a normal single-root document (<a/>). The security-relevant property is the silent acceptance of not-well-formed input: xmldom's parse result disagrees with the specification and with browser XML parsers, so any control that treats "xmldom parsed it without error" as "well-formed" is bypassed.

Root Cause

On the 0.9.x line, where the line-terminator variant specifically leaks:

  1. A shared regexp builder compiles anchored productions with the m flag.
  2. ^…$ under m are line anchors, not string anchors.
  3. The anchored end-tag production ^ QName S? $ is therefore satisfied by the first line alone, so trailing content after a line terminator is neither matched nor rejected — the malformed end tag is accepted and the residue silently discarded.

The triggering line terminators are the ECMAScript LineTerminator set: U+000A, U+000D, U+2028, U+2029. U+2028 and U+2029 are not XML whitespace, so they are non-conforming trailing content that nonetheless leaks because the JavaScript $ anchor treats them as line boundaries under m.

Affected Versions

Both maintained versions are affected and fixed:

  • 0.9.x (>= 0.9.0, <= 0.9.11) → 0.9.12: the anchored end-tag validator's m flag leaks the line-terminator variant. The whitespace variant (</a junk>) is already rejected on this line.
  • 0.8.x (>= 0.8.0, <= 0.8.14) → 0.8.15: no anchored end-tag validator at all — both the line-terminator and the whitespace variant are silently accepted; the fix adds a residue check.

release-0.7.x (<= 0.7.13) and the unscoped xmldom package (range *, last release 0.6.0) are affected but will not be patched — they are end-of-life / unmaintained. They share the older-line behavior (both variants silently accepted, residue dropped).

Proof of Concept

const { DOMParser, XMLSerializer } = require('@xmldom/xmldom');
const doc = new DOMParser().parseFromString('<a></a\njunk>', 'text/xml'); // no error
console.log(new XMLSerializer().serializeToString(doc));
// Observed: <a/>   — the malformed end tag is accepted, "junk" silently discarded, no error reported.
// Expected (per XML spec / Chromium / Firefox): a parse error — the input is not well-formed.

Impact

  • Silent acceptance of not-well-formed XML: a document the specification and browser XML parsers reject is parsed without error.
  • Bypass of a well-formedness / parse-before-trust gate: an application relying on xmldom to reject malformed input treats such a document as valid. Note this is an input-validation / parser-differential issue, not content injection — the trailing content is discarded.

Fix Applied

The parser now reports a not-well-formed end tag whose valid name is followed by trailing content, on both 0.9.12 and 0.8.15 — previously it was accepted silently — and parsing recovers to the byte-identical DOM as before.
On 0.9.12 the anchored end-tag validator is corrected so a line break followed by trailing content no longer satisfies it, reported as a recoverable error when parsing as XML and a warning when parsing as HTML.
On 0.8.15, which previously performed no end-tag residue validation, an equivalent residue check is added, reported as a recoverable error in both XML and HTML.
Well-formed documents are unaffected.

Because the report is recoverable, the fix is non-breaking: no previously-parsed document begins to throw and no serialized output changes. Consumers that want strict rejection can escalate the reported error to a fatal one via the parser's error handler (onError in 0.9.12, errorHandler in 0.8.15). The two versions also differ in the whitespace-separated variant (</a junk>): 0.9.12 already rejected it with a fatal error in XML and continues to, while 0.8.15 — which validated neither variant — now emits the same recoverable report for both the whitespace and line-break variants.

Residual limitation

By default the parser still recovers (it does not reject the document); the reported condition is a recoverable error/warning, not a fatal error, to avoid changing the parsed output in a patch release. Converting this and the other not-well-formed-acceptance cases to a consistent fatalError — including the broader end-tag leniency on the older versions — is deferred to the next breaking release, tracked at xmldom/xmldom#1074.

Affected Packages

3 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npm@xmldom/xmldom0.7.0&&< 0.8.150.8.15
📦npm@xmldom/xmldom0.9.0&&< 0.9.120.9.12
📦npmxmldomall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @xmldom/xmldom. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update @xmldom/xmldom to 0.8.15 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6h8r-xr42-gp59 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-6h8r-xr42-gp59 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-6h8r-xr42-gp59. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary xmldom's parser silently accepts a **not-well-formed end tag** whose valid name is followed by trailing content — e.g. `</a⏎junk>`. The element is closed, the trailing content is discarded, and no error is reported, even though the XML end-tag production allows only optional whitespace after the name and both Chromium and Firefox reject such input as `application/xml`. An application that relies on xmldom to reject not-well-formed input therefore receives a false "valid" result for a document the specification and browsers consider malformed. ## Details Across every affected vers
O3 Security · Impact-Aware SCA

Is GHSA-6h8r-xr42-gp59 in your dependencies?

O3 detects GHSA-6h8r-xr42-gp59 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-6h8r-xr42-gp59: @xmldom/xmldom | O3 Security