Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
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 applicationsUpgrade domutils to version 4.1.0 or higher.
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.
import { parseDocument } from "htmlparser2";
import { findOne } from "domutils";
findOne(() => false, parseDocument("<b>".repeat(20_000)).children);
// RangeError: Maximum call stack size exceeded