Uncontrolled Recursion Affecting domutils package, versions >=1.0.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-23745877
  • published4 Dec 2026
  • disclosed4 Dec 2026
  • creditUgur Celik

Introduced: 4 Dec 2026

NewCVE-2026-145166  (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 findOne(), existsOne(), and getElementById(), which recurse once per level of nesting in a document. An attacker can supply HTML or XML with approximately 20,000 nested elements to exhaust the JavaScript call stack, causing a RangeError that results in request failures or process termination.

PoC

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

findOne(() => false, parseDocument("<b>".repeat(20_000)).children);
// RangeError: Maximum call stack size exceeded

CVSS Base Scores

version 4.0
version 3.1