Skip to main content

DOMPurify CVE-2026-144292

| EUVDEUVD-2026-143510 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-12-03 security-advisories@github.com GHSA-hrxw-jjj6-2g2j
7.6
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted nested-form markup
  2. Delivery
    Stored and sanitized under SAFE_FOR_TEMPLATES
  3. Exploit
    Output reparsed via innerHTML merges brace fragments
  4. Execution
    Template engine compiles reconstructed {{expression}}
  5. Impact
    Arbitrary JavaScript executes in page origin

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires DOMPurify earlier than 3.5.0 running with the SAFE_FOR_TEMPLATES:true option enabled (its documented protective mode), AND the consuming application must assign the sanitized output back into the DOM via innerHTML (a second parse) AND compile that DOM with a client-side template engine - confirmed against Vue 3 in-DOM templates and AngularJS 1.8.3. The payload uses nested <form> elements so that brace fragments stay in separate text nodes during sanitization and become adjacent on reparse. Limiting factors that reduce realistic risk: the SAFE_FOR_TEMPLATES option must be on; a template engine must actually recompile the reparsed output (applications that only insert sanitized HTML without a template compiler are unaffected); plain unsplit {{...}} expressions are still correctly scrubbed; and a victim must view the rendered content (UI:P). No special privileges are needed to submit the markup (PR:N).

Impact

The vendor CVSS 4.0 base score is 7.6 (HIGH) with vector AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L. The network vector and PR:N (unauthenticated) point to a broadly reachable flaw, but two modifiers temper real-world risk: AT:P signals a required attack precondition and UI:P requires a victim to view the content. There is no CISA KEV entry and no EPSS score in the supplied data, so there is no evidence of active or widespread exploitation - this is not confirmed in-the-wild activity. However, the GHSA advisory contains a complete, author-reproduced proof-of-concept (verified across Chromium 156, Firefox 157, WebKit 27.2 with Vue 3.5.45 and AngularJS 1.8.3), so the exploitation barrier is low where the precondition is met. The decisive limiter is that precondition: exploitation only works when SAFE_FOR_TEMPLATES is enabled AND the sanitized output is reparsed via innerHTML and compiled by a client-side template engine. Applications that use DOMPurify without a template engine, or without SAFE_FOR_TEMPLATES, are not exploitable through this path. The vuln.today decision label is 'this_week' (not act_now/emergency), which aligns with a serious, PoC-backed sanitizer-bypass that is nonetheless gated by a non-universal deployment pattern. Net assessment: a credible, patchable priority for the affected subset rather than an internet-wide emergency; the high CVSS is real but its blast radius is narrowed by the template-engine prerequisite.

Exploit ScenarioDerived

An attacker submits attacker-controlled markup (a comment, profile field, or rich-text message) containing a nested-<form> payload to an application that sanitizes input with DOMPurify SAFE_FOR_TEMPLATES and then renders the result into the DOM via innerHTML where a template engine (e.g. Vue 3 in-DOM templates or AngularJS) compiles it. On the second parse the separated brace fragments merge into a live {{...}} expression that the engine evaluates, executing arbitrary JavaScript in the page origin for every viewer. A working PoC reproducing this across three browsers is published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 1.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 03, 2026

HTML sanitization bypass in DOMPurify (npm package, all versions before 3.5.0) allows markup submitted by an unauthenticated attacker to survive DOMPurify.sanitize() with SAFE_FOR_TEMPLATES:true in a form where the braces of a template expression are split across separate text nodes by nested <form> elements, then become adjacent again when the returned string is assigned to innerHTML. If the consuming application compiles that reparsed DOM with a client-side template engine - the advisory reproduces execution against Vue 3 in-DOM templates and AngularJS 1.8.3 - the reconstructed {{…}} expression is evaluated and arbitrary JavaScript runs in the page origin, enabling session theft and actions on behalf of every viewer. Exploitation is conditional: the protective SAFE_FOR_TEMPLATES option must be enabled, the output must be reinserted via innerHTML, and a template engine must recompile it, while plain unsplit {{…}} expressions remain correctly scrubbed; a public proof-of-concept is published in the vendor advisory (reproduced in Chromium, Firefox and WebKit), there is no CISA KEV entry or other indication of active exploitation, and the vendor fix is released in 3.5.0.

RemediationAI

Vendor-released patch: DOMPurify 3.5.0. Upgrade the npm dependency to 3.5.0 (https://github.com/cure53/DOMPurify/releases/tag/3.5.0) and confirm any bundled, vendored or CDN-pinned copies are updated to the same version; the fix landed via https://github.com/cure53/DOMPurify/pull/1744 and commit https://github.com/cure53/DOMPurify/commit/d05b24333a25f6f2e949493749523563f15230e2, and full technical details are in GHSA-hrxw-jjj6-2g2j. Because exploitation depends on a specific pipeline (SAFE_FOR_TEMPLATES enabled, sanitized output reassigned to innerHTML, and a template engine compiling that DOM), inventory first whether both conditions hold in your codebase and prioritize patching those paths; the vulnerability is rated this_week in the vuln.today priority scheme, and no active exploitation is recorded in CISA KEV. Where an immediate upgrade is not possible, remove any application step that reinserts SAFE_FOR_TEMPLATES output through innerHTML before template compilation, or disable SAFE_FOR_TEMPLATES only if untrusted content is never passed to a template engine - both changes shift the risk rather than eliminate it, since dropping the option re-exposes template expressions directly and abandoning the reparse step changes rendering behaviour. The advisory also suggests that, under SAFE_FOR_TEMPLATES, a <form> nested inside another <form> cannot survive a reparse and can be dropped, and that text-node fragments of a bare '{' or '}' should be treated as unsafe across an element boundary; if you maintain a fork, backporting that logic plus a regression test for the nested-form shape is the durable fix. Untrusted markup should not reach a DOM template compiler with attacker-controlled expressions regardless of sanitizer version.

Affected VersionsENISA

DOMPurify < 3.5.0

Affected Packages

npm dompurify fix: 3.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

DOMPurify is a DOM-only sanitizer for HTML, MathML and SVG: it parses untrusted markup into a tree, walks that tree, and serializes the result back to a string. SAFE_FOR_TEMPLATES is its documented protective mode for pages that later hand the sanitized string to a template engine, and the advisory shows it is enforced in two places in src/purify.ts - a per-text-node scrub during the walk and a post-serialization tree scrub gated on TMPL_MARKER_SERIALIZED (/{{|}}|\${|<%|%>|&lt;%|%&gt;/) in src/regexp.ts. Both checks operate on DOMPurify's own tree and on the serialized string, but the output is not stable under the second parse the consumer performs. In the payload, </form> clears the HTML parser's form element pointer while a <div> is still open, so a second <form> nests inside the <div> and the fragments '{', '{…}' and '}' live in three separate text nodes with an element between them; serialization yields <form><div>{<form>{…}</form>}</div></form>, which contains no literal {{ or }} so the marker scrub never fires. On reparse through innerHTML the nested <form> start tag is dropped because a form is already open, the three fragments merge into one text node, and the template engine compiles the reassembled expression. The weakness is both a sanitizer-output reparse mismatch (CWE-79) and, per the GitHub advisory, client-side template injection (CWE-1336). Affected versions are the npm/dompurify package below 3.5.0 (EUVD: DOMPurify < 3.5.0; reproduced on 3.4.18, then npm latest).

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 7.6 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
vuln.today AI 8.2 HIGH

Unauthenticated markup submission (PR:N) but exploitation depends on the consumer reparsing output through a template engine (AC:H) and a victim viewing it (UI:R); origin-level script execution crosses into the app's context (S:C) with high confidentiality/integrity and low availability impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:L
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Dec 03, 2026 - 18:19 EUVD
CVE Published
Dec 03, 2026 - 18:17 cve.org
HIGH 7.6

DescriptionCVE.org

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.5.0, DOMPurify.sanitize() with SAFE_FOR_TEMPLATES can return attacker-controlled markup whose brace fragments remain separated during sanitization but become adjacent when nested form elements are reparsed through innerHTML. A template engine that compiles the reparsed DOM can evaluate the reconstructed expression, allowing arbitrary JavaScript execution in the page origin. Plain unsplit template expressions remain scrubbed, and exploitation requires the sanitized output to be reparsed and compiled by a template engine. This issue is fixed in version 3.5.0.

Technical POC Analysis

CWE-79 (the advisory also tags CWE-1336, template-engine injection).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A high-severity vulnerability in DOMPurify (versions before 3.5.0) allows attackers to bypass HTML sanitization under specific conditions, potentially leading to session theft and unauthorized actions on behalf of users. This affects web applications that rely on DOMPurify with SAFE_FOR_TEMPLATES and client-side template engines like Vue 3 or AngularJS, putting user data and application integrity at risk.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
1.2%
Top 31% exploitable
Prevalence
High
de-facto standard client-side HTML sanitizer, very widely deployed in web frontends
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 1.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy