CVE Professor
/
All CVEs
CVE-2026-140391

CVE-2026-140391 — Dompurify — CWE-79 · CWE-1336

MEDIUM CVSS 6.1 ⚡ EPSS 0.5% GitHub

### Summary With `SAFE_FOR_TEMPLATES: true`, DOMPurify 3.4.17 returns strings that contain no `{{` or `}}`, but which turn into a live `{{…}}` expression as soon as the string is assigned to `innerHTML`. A template engine that then compiles that DOM (verified with Vue 3 in-DOM templates and AngularJS 1.8.3) evaluates the attacker's expression, giving arbitrary JavaScript execution. The attacker controls only the markup passed to `sanitize()`. The only configuration required is `SAFE_FOR_TEMPLATES: true`, which is a protective option, and the application uses it for its documented purpose. There are two independent variants. Both variants reproduce on Chromium 156, Firefox 157 and WebKit 27.2. The plain `{{…}}` case and the "expression split by a removed element" case are still correctly scrubbed, so this is a gap in the existing protection, not a missing feature. ### Details `SAFE_FOR_TEMPLATES` scrubbing happens in two places, and neither accounts for how the returned string is parsed a second time by the consumer. 1. Per text node, during the walk (`src/purify.ts`, around line 2396): ```ts if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { const content = _stripTemplateExpressions(currentNode.textContent); ... ``` 2. On the final serialized string (`src/purify.ts`, around line 3273): ```ts if (SAFE_FOR_TEMPLATES) { serializedHTML = _stripTemplateExpressions(serializedHTML); } ``` Both use the expressions in

### Summary With `SAFE_FOR_TEMPLATES: true`, DOMPurify 3.4.17 returns strings that contain no `{{` or `}}`, but which turn into a live `{{…}}` expression as soon as the string is assigned to `innerHTML`. A template engine that then compiles that DOM (verified with Vue 3 in-DOM templates and AngularJS 1.8.3) evaluates the attacker's expression, giving arbitrary JavaScript execution. The attacker controls only the markup passed to `sanitize()`. The only configuration required is `SAFE_FOR_TEMPLATES: true`, which is a protective option, and the application uses it for its documented purpose. There are two independent variants. Both variants reproduce on Chromium 156, Firefox 157 and WebKit 27.2. The plain `{{…}}` case and the "expression split by a removed element" case are still correctly scrubbed, so this is a gap in the existing protection, not a missing feature. ### Details `SAFE_FOR_TEMPLATES` scrubbing happens in two places, and neither accounts for how the returned string is parsed a second time by the consumer. 1. Per text node, during the walk (`src/purify.ts`, around line 2396): ```ts if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { const content = _stripTemplateExpressions(currentNode.textContent); ... ``` 2. On the final serialized string (`src/purify.ts`, around line 3273): ```ts if (SAFE_FOR_TEMPLATES) { serializedHTML = _stripTemplateExpressions(serializedHTML); } ``` Both use the expressions in

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction Required UI:R
Scope Changed S:C
Confidentiality Low C:L
Integrity Low I:L
Availability None A:N
EPSS — Exploit Prediction Scoring System
0.5%
30-day probability
In the 45. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140391
CVSS 6.1/10 · MEDIUM · 01.12.2026
CWE: CWE-79, CWE-1336
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 WHAT IS THIS VULNERABILITY?
Cross-Site Scripting (XSS)
Summary: ### Summary

With SAFE_FOR_TEMPLATES: true, DOMPurify 3.4.17 returns strings that contain no {{ or }}, but which turn into a live {{…}} expression as soon as the string is assigned to innerHTML. A template engine that then compiles that DOM (verified with Vue 3 in-DOM templates and AngularJS 1.8.3) evaluates the attacker's expression, giving arbitrary JavaScript execution. The attac…
Affected: dompurify

⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · user interaction required (UI:R) · low attack complexity (AC:L).
⚠️ Scope changes (S:C) — impact can cross security boundaries.

🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); limited integrity modification (I:L); pivot to other systems possible.

🛡️ REMEDIATION
→ Apply vendor security update for dompurify.
→ Add CSP headers, HTML-encode all user input.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.

⚠️ URGENCY
📋 Routine update cycle (30 days)

────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
6.1 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-79 CWE-1336
Affected Products (1)
dompurify
References & Advisories (4)
Related CVEs
7.6
CVE-2026-144292
### Summary With `SAFE_FOR_TEMPLATES: true`, DOMPurify 3.4.18 returns a string that contains no `{{` or `}}`,
9.8
CVE-2026-105104
Use of hard-coded credentials in Elinktek UZ801 4G LTE USB Dongle firmware UFI003S_V03_ZX_DD_250226 and earlie
9.4
CVE-2026-126099
The Velocity template sandbox (SecureIntrospectorImpl) in dotCMS through 26.11.03-01, and in the 25.07 LTS lin
9.3
CVE-2026-144337
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulner
9.0
CVE-2026-145039
SiYuan before 3.8.11 contains a stored cross-site scripting vulnerability in the protyle asset picker's render
8.8
CVE-2026-145062
SiYuan 3.8.10 before 3.8.11 fails to escape custom block attribute names from imported .sy.zip files in openFi
8.6
CVE-2026-120094
Improper authorization in the dotAI embeddings endpoint (POST /api/v1/ai/embeddings) in dotCMS before 26.10.23