CyberRota Analysis
AI-GeneratedVersions of DOMPurify from 3.0.0 to 3.4.8, when configured with SAFE_FOR_TEMPLATES and certain DOM output modes, are vulnerable to failing to sanitize template expressions within `<template>` elements. This oversight can allow an attacker to inject and execute malicious expressions in downstream template engines, posing a risk of code execution or data leakage. Developers and organizations using these specific versions of DOMPurify in applications that handle untrusted content should prioritize upgrading to mitigate this vulnerability.
Public Exploit Signal
A public exploit, PoC, GitHub repository or Metasploit reference was detected for this CVE.
Note: these links are listed for security research and verification purposes only.
Original NVD Description
DOMPurify versions >=3.0.0 and before 3.4.8, when configured with SAFE_FOR_TEMPLATES together with a DOM output mode (RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE), fail to strip template expressions (e.g. ${evil}, {{evil}}, <%evil%>) inside <template> element content. The final normalization/scrub pass (_scrubTemplateExpressions) uses a NodeIterator and node.normalize() that do not descend into template.content, so expressions that only form after adjacent text nodes merge survive sanitization. This bypasses SAFE_FOR_TEMPLATES and can allow a downstream template engine to evaluate attacker-supplied expressions. The string output path is not affected.
Related CVEs
Other vulnerabilities affecting the same vendor(s)