When configured with `SAFE FOR TEMPLATES` and a DOM output mode (`RETURN DOM`, `RETURN DOM FRAGMENT`, or `IN PLACE`), the software fails to strip template expressions such as `${evil}`, `{{evil}}`, or `<%evil%>` within `<template>` element content. This occurs because the ` scrubTemplateExpressions()` function uses a NodeIterator and `node.normalize()` that do not descend into `template.content`, allowing expressions formed by the merging of adjacent text nodes to survive sanitization. This bypasses the `SAFE FOR TEMPLATES` protection and may allow a downstream template engine to evaluate attacker-supplied expressions. The string output path is not affected.