The vulnerability is rooted in seven different DOM operations within lib/dom.js that were implemented using recursive tree traversal without any depth limit. When these operations are performed on a deeply nested XML document, the JavaScript call stack is exhausted, leading to a RangeError: Maximum call stack size exceeded which crashes the Node.js process, causing a denial of service. The vulnerable functions include normalize, serializeToString, cloneNode, importNode, isEqualNode, the textContent getter, and the internal _visitNode function (used by getElementsByTagName, getElementsByTagNameNS, getElementsByClassName, and getElementById). The fix, applied across multiple commits, was to replace these recursive implementations with iterative ones. A new walkDOM utility, which uses an explicit stack (heap memory) instead of the call stack, was introduced and used to refactor six of the seven functions. The seventh, isEqualNode, required a custom iterative implementation because it needs to traverse two trees in parallel. By analyzing the removal of the recursive calls in the patch files, the specific vulnerable functions were identified.