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 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.
import { parseDocument } from "htmlparser2";
import { getText } from "domutils";
getText(parseDocument("<b>".repeat(10_000) + "x").children);
// RangeError: Maximum call stack size exceeded