Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted nested-form markup
-
DeliveryStored and sanitized under SAFE_FOR_TEMPLATES
-
ExploitOutput reparsed via innerHTML merges brace fragments
-
ExecutionTemplate engine compiles reconstructed {{expression}}
-
ImpactArbitrary 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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 (/{{|}}|\${|<%|%>|<%|%>/) 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
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
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.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-143510
GHSA-hrxw-jjj6-2g2j
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB