CVE-2026-65900 PUBLISHED

DOMPurify before 3.4.8 Template Expression Injection via RETURN_DOM

Assigner: VulnCheck
Reserved: 23.07.2026 Published: 23.07.2026 Updated: 23.07.2026

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.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
CVSS Score: 5.1

Product Status

Vendor cure53
Product DOMPurify
Versions Default: unaffected
  • affected from 3.0.0 to 3.4.8 (excl.)
  • Version 3.4.8 is unaffected

Credits

  • IamLeandrooooo reporter

References

Problem Types

  • Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') CWE