highVulnerability

CVE-2026-83612

## Summary In HTML mode (`text/html`), a raw-text element (`script`, `style`, `textarea`, `title`) whose closing tag differs in case from its opening tag (e.g. `</ScRiPt>` for `<script>`) is mishandled by the parser, producing quadratic (O(n²)) output growth — a small crafted document parses and serializes into output orders of magnitude larger, exhausting CPU and memory. A modest input of tens of KB can therefore cause a denial of service in any service that parses untrusted HTML with xmldom. Only HTML mode is affected. ## Details The parser calls `parseHtmlSpecialContent` for each raw-text element in HTML mode, matched via `isHTMLRawTextElement` / `isHTMLEscapableRawTextElement` (so all four types — `script`, `style`, `textarea`, `title` — are in scope). It searches for the element's closing tag with `source.indexOf('</' + tagName + '>', elStartEnd)`, a byte-for-byte case-sensitive match. A mixed-case closing tag never matches, so the search returns `-1`, and the following `source.substring(elStartEnd + 1, -1)` extracts text backwards from the start of the document instead of the element's content. The function then returns `-1` to the parse loop, which cannot advance normally and falls back to character-by-character reprocessing. Every raw-text element re-captures all source text preceding it, so output grows as O(n²) in the number of such elements. ### Root Cause 1. **Case-sensitive close-tag search** (`lib/sax.js:549`): `source.indexOf('</' + tagName + '>', elStartEnd)` does not fold case, contrary to the WHATWG HTML RAWTEXT end-tag-name rule. 2. **Unguarded `-1`** (`lib/sax.js:550`): `source.substring(elStartEnd + 1, elEndStart)` runs even when `elEndStart === -1`, extracting text backwards from position 0. 3. **Unstable progression** (`lib/sax.js:556`): the function returns `elEndStart` (`-1`), driving repeated character-by-character fallback in the parse loop. ## Affected Versions Only the `0.9.x` line is affected — the amplification was intr

Properties

ghsa_id
GHSA-6mj3-qw4j-hgrw
summary
xmldom: HTML raw-text closing-tag case mismatch causes output amplification
severity
high
epss_score
0.00301
cve_id
CVE-2026-83612
is_ghsa_only
false
ghsa_published
2026-09-08T20:59:54Z
source_url
https://github.com/advisories/GHSA-6mj3-qw4j-hgrw
epss_percentile
0.22449
ghsa_updated
2026-09-08T20:59:55Z

Related Entities (6)

ENRICHED_BY (1)

[Source]FIRST EPSS

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]npm/@xmldom/xmldom

AFFECTS (1)

[Software]npm/@xmldom/xmldom

HAS_WEAKNESS (2)

[Weakness]Improper Handling of Case Sensitivity
[Weakness]Uncontrolled Resource Consumption

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-83612 — Ninja Signal Threat Intelligence | Ninja Signal