CVE Watchtower

CVE-2026-83619@xmldom/xmldom Uncontrolled Resource Consumption

NVD

Vulnerability Summary

## Summary

On the `@xmldom/xmldom` **`0.8.x`** line, parsing an XML end tag whose name is followed by a long run
of whitespace and then a non-whitespace character triggers quadratic-time regular-expression
backtracking (ReDoS), so a single small crafted end tag stalls the Node.js event loop. It is reachable
from `DOMParser.parseFromString` under **default options**, unauthenticated, before any validity
check — an availability-only denial of service. The `0.9.x` line is **not** affected.

## Details

`lib/sax.js` (release-0.8.x, commit `e5c1480`) trims trailing whitespace from a captured end-tag name
with an unanchored global regex:

- `lib/sax.js` line 120: https://github.com/xmldom/xmldom/blob/e5c14802592685bb872c042c54c3f73758875c85/lib/sax.js#L120

```js
/[ \t\n\r]+$/g
```

Applied to a string shaped `whitespace-run + one non-whitespace char` (e.g. the content of an end tag
`</ … x>`), the engine must, for every starting position, extend `[ws]+` to the end and then fail
the `$` anchor when the trailing non-whitespace char is present — classic O(n²) backtracking in the
length of the whitespace run. The trimmed substring is delimited only by `indexOf('>')`, so the
attacker controls its length directly.

## Proof of Concept

```js
const { DOMParser } = require('@xmldom/xmldom'); // 0.8.x
const n = 64 * 1024;
const payload = '<r></' + ' '.repeat(n) + 'x>';
console.time('parse');
new DOMParser().parseFromString(payload, 'text/xml');
console.timeEnd('parse');
```

Measured (Node 18) — time quadruples per doubling of the whitespace run (canonical O(n²)):

| Whitespace run | Isolated regex | End-to-end `parseFromString` (0.8.13) |
|---|---|---|
| 4 KB | 5.6 ms | 5.7 ms |
| 8 KB | 22.7 ms | 22.5 ms |
| 16 KB | 88.6 ms | 92 ms |
| 32 KB | 354 ms | 361 ms |
| 64 KB | 1434 ms | 1452 ms |
| 128 KB | 5761 ms | — |

## Impact

Availability only: a single parse of a small crafted document blocks the Node.js event loop for the
duration of the quadratic scan (≈1.4 s at 64 KB; multi-second with larger inputs). No memory
blow-up, no data exposure, no integrity impact. Because XML is routinely accepted from untrusted
sources and parsed with default options, one request can stall a server.

## Affected Versions

Affected on the `0.7.x` and `0.8.x` lines (the trailing-whitespace trim was added in `0.7.0`, present
through `0.8.14`); the fix targets the `0.8.x` LTS patch. The `0.9.x` line rewrote end-tag parsing to
an anchored linear matcher and never had this regex, so it is **not** affected. No published unscoped
`xmldom` is affected — the vulnerable code exists only in a `0.7.0` git tag that was never released to
npm (`npm view xmldom` → `latest` = 0.6.0).

## Fix Applied

Anchors the end-tag trailing-whitespace trim so it runs in linear time instead of
backtracking quadratically on a long whitespace run. Byte-identical output. Non-breaking; 0.8.x-only.

## Severity note

The complexity is **quadratic**, not exponential, so a multi-second stall requires
tens-to-hundreds of KB of input. `VA:H` reflects that xmldom applies **no input-size limit** and the
path runs on default-options parsing, so a single unbounded parse can fully stall the event loop.
Severity Level
HIGH
Published Date
Sep 1, 2026
Last Modified
Sep 8, 2026
Exploitation Status
Public exploit available
CVE Record Status
Published
EPSS Score (30-Day)
0.52%Probability
Root Weakness (CWE)
The product does not properly control the allocation and maintenance of a limited resource, enabling denial-of-service conditions.
The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
CVSS v4.0 Base Metrics — Score 8.7
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Attack VectorNetwork
Attack ComplexityLow
Attack RequirementsNone
Privileges RequiredNone
User InteractionNone
Confidentiality (Vulnerable System)None
Integrity (Vulnerable System)None
Availability (Vulnerable System)High
Confidentiality (Subsequent System)None
Integrity (Subsequent System)None
Availability (Subsequent System)None

Affected & Patched Versions

Affected Versions
  • @xmldom/xmldom >= 0.7.0, <= 0.8.14
Patched Versions
No patched version published yet
Until a fix ships, reduce exposure:
  • Restrict access to the affected service or interface to trusted networks.
  • Disable the affected feature if you do not need it.
  • Watch the vendor advisory for a firmware or software update.

What to do

Prioritize this fix. Exploit code is public, so attacks can follow quickly.

  1. Check whether you run @xmldom/xmldom and which version.
  2. No patched version is listed yet. Limit access to the affected service to trusted networks, and disable the feature if you can.
  3. Subscribe to the vendor advisory so you learn when a fix ships.
  4. Review logs and exposed services for signs of earlier compromise.

Timeline

  • Sep 1, 2026Published
  • Sep 8, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new @xmldom/xmldom CVEsYou are reading CVE-2026-83619. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Sep 23, 2026 10:57 UTC