Read the docs

DOMPurify sanitizer bypass lets template expressions run JavaScript

Priority HIGH 68CWE-1336Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Passive
Attack complexity
Low
Attack requirements
Present
Impact type
Code execution, Cross-site scripting
Confidentiality · integrity · availability
High · High · Low
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-1336 and CWE-79.

Summary

DOMPurify versions before 3.5.0 are affected, including the npm package dompurify before 3.5.0. With SAFE_FOR_TEMPLATES, sanitize() can return markup whose template brace fragments stay separate during sanitization but join when nested form elements are reparsed through innerHTML (CWE-1336). A remote attacker can exploit this when a template engine compiles the reparsed DOM, which evaluates the rebuilt expression and runs JavaScript in the page origin. Plain unsplit template expressions remain scrubbed.

Written with Claude Haiku 5.5 from the sources below · 2026-12-04

Description from the CNA

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
Fix Fixed DOMPurify (cure53): 3.5.0dompurify (npm): 3.5.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
cure53DOMPurifybefore 3.5.03.5.0Patch availableCNA
—dompurify (npm)before 3.5.03.5.0Patch availableGHSA-hrxw-jjj6-2g2j
  • DOMPurify Vendorcure53 Affected before 3.5.0 Fixed in 3.5.0 Patch available CNA
  • dompurify (npm) Vendor— Affected before 3.5.0 Fixed in 3.5.0 Patch available GHSA-hrxw-jjj6-2g2j

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*——cure53
  • cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:* Versions — — ·cure53

Remediation

Upgrade DOMPurify to version 3.5.0, which fixes this issue, including the npm package dompurify.

Written with Claude Haiku 5.5 from the sources below · 2026-12-04

  • Fix · CNA DOMPurify (cure53) Fixed in 3.5.0
  • Fix · GHSA-hrxw-jjj6-2g2j dompurify (npm) Fixed in 3.5.0 Advisory →

Timeline

  1. 2026-12-03 Threatist record created from CVE-2026-144292
  2. 2026-12-03 CISA SSVC decision points changed
  3. 2026-12-04 Alias added: GHSA-hrxw-jjj6-2g2j
  4. 2026-12-04 Fix available: npm/[email protected] · GHSA-hrxw-jjj6-2g2j
  5. 2026-12-04 CVSS score added · GHSA-hrxw-jjj6-2g2j
  6. 2026-12-04 Weakness changed · GHSA-hrxw-jjj6-2g2j
  7. 2026-12-04 6 new references · GHSA-hrxw-jjj6-2g2j

References

  • TI-2026-34986 DOMPurify XSS via `selectedcontent` re-clone CVSS 3.1HIGH 8.2
  • TI-2025-30422 Path traversal in cure53 DOMPurify CVSS 3.1HIGH 7.5
  • TI-2026-29847 DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback CVSS 3.1MEDIUM 6.9
  • TI-2026-36811 DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content CVSS 4.0MEDIUM 6.3
  • TI-2026-36614 DOMPurify: IN_PLACE mode preserves attributes of a clobbered root element, allowing XSS via attacker-controlled root DOM CVSS 3.1MEDIUM 6.1
  • TI-2026-36613 DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checks CVSS 3.1MEDIUM 6.1
See all 36 →

Sources