Uncontrolled Recursion Affecting domutils package, versions >=1.1.0 <4.1.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-DOMUTILS-23745869
  • published4 Dec 2026
  • disclosed4 Dec 2026
  • creditLinus Shyu, Ugur Celik (ucsurf)

Introduced: 4 Dec 2026

NewCVE-2026-145167  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade domutils to version 4.1.0 or higher.

Overview

Affected versions of this package are vulnerable to Uncontrolled Recursion via getText(), textContent(), and innerText() in src/stringify.ts, which call themselves once per level of nesting. An attacker can supply an HTML or XML document with approximately 10,000 nested elements to exhaust the JavaScript call stack, triggering a RangeError that fails the request or terminates the Node.js process.

PoC

import { parseDocument } from "htmlparser2";
import { getText } from "domutils";

getText(parseDocument("<b>".repeat(10_000) + "x").children);
// RangeError: Maximum call stack size exceeded

CVSS Base Scores

version 4.0
version 3.1