A vulnerability in DOMPurify when configured with SAFE_FOR_TEMPLATES and a DOM-returning mode allows template expressions split across text nodes in attached shadow roots to survive sanitization. This occurs because the post-walk safety net does not recurse into shadow roots, enabling attackers who supply DOM nodes with shadow roots to inject expressions that are later evaluated by template engines. Exploitation requires specific non-default configurations and attacker control over DOM nodes with attached shadow roots. The vulnerability is fixed in version 3.4.17.