Skip to content
Heist/ feed
Back to feed
Medium

DOMPurify before 3.4.8 Template Expression Injection via RETURN_DOM

Type: advisorySources: OSV

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 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-65900
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 18:53 UTC · Revision 1

Source evidence

DOMPurify before 3.4.8 Template Expression Injection via RETURN_DOM

core-osv · Original source

Published 23 Jul 2026, 13:16 UTC

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 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.

osv:CVE-2026-65900
Complete source record
{
  "id": "4ade20553f71c98ab61f876b1a540a885d0577a303e20494b74b969b5fc59930",
  "url": "https://osv.dev/vulnerability/CVE-2026-65900",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DOMPurify before 3.4.8 Template Expression Injection via RETURN_DOM",
    "summary": "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 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.",
    "evidence": "osv:CVE-2026-65900",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-65900",
      "aliases": [
        "CVE-2026-65900",
        "GHSA-gvmj-g25r-r7wr"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/cure53/dompurify",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5dcf2a012c70ea8b65c0ecff7de86a61d7d98181"
                },
                {
                  "fixed": "bcdd8285412dc9c4c149652aed2d712e790d6ccf"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "3.0.0"
                      },
                      {
                        "fixed": "3.4.8"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "cpe": "cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.0.0"
                      },
                      {
                        "fixed": "3.4.8"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-65900.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:22.423972088Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/65xxx/CVE-2026-65900.json",
        "https://github.com/cure53/DOMPurify/security/advisories/GHSA-gvmj-g25r-r7wr",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-65900",
        "https://www.vulncheck.com/advisories/dompurify-before-template-expression-injection-via-return-dom"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "VulnCheck",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/65xxx/CVE-2026-65900.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-65900",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 488813,
  "published_at": "2026-07-23T13:16:19.045+00:00"
}