# dompurify (npm)

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It runs as JavaScript and works in all modern browsers, as well as in Node.js (via jsdom). DOMPurify is written by security people who have vast background in web a

- Latest: 3.5.1 (2026-12-02)
- Licence: (MPL-2.0 OR Apache-2.0)
- Downloads: 446286666 last month
- Advisories on the latest version: 0

- CVE-2026-144292 HIGH: DOMPurify SAFE_FOR_TEMPLATES bypass: nested <form> makes a template expression reassemble when sanitized output is reparsed Fixed in 3.5.0.
- CVE-2026-140391 MODERATE: DOMPurify: SAFE_FOR_TEMPLATES bypass: template expressions reassemble when sanitized output is reparsed (nested <form> and orphaned end tags) Fixed in 3.4.18.
- CVE-2026-116802 LOW: DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml Fixed in 3.4.17.
- CVE-2026-116804 LOW: DOMPurify SAFE_FOR_TEMPLATES bypass: split template expressions survive in attached shadow root content on DOM output modes Fixed in 3.4.17.
- CVE-2026-116803 LOW: DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed (incomplete fix for GHSA-p98j-92pf-mc4p) Fixed in 3.4.17.
- CVE-2026-109345 LOW: DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executes Fixed in 3.4.16.
- CVE-2026-109344 LOW: DOMPurify: IN_PLACE: node-removing afterSanitize hook leaves detached subtree event handlers armed, causing DOM XSS Fixed in 3.4.16.
- CVE-2026-75838 MODERATE: DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS Fixed in 3.4.13.
- CVE-2026-66010 LOW: DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements. Fixed in 3.4.12.
- CVE-2026-65898 MODERATE: DOMPurify: Permanent `ALLOWED_ATTR` pollution via `setConfig()` bypassing the hook clone-guard (incomplete fix of the 3.4.7 hook-pollution patch) Fixed in 3.4.11.
- CVE-2026-65902 MODERATE: DOMPurify: Hook mutation of `data.allowedTags` / `data.allowedAttributes` permanently pollutes `DEFAULT_ALLOWED_TAGS` / `DEFAULT_ALLOWED_ATTR` Fixed in 3.4.7.
- CVE-2026-65900 LOW: DOMPurify: SAFE_FOR_TEMPLATES bypass - template expressions survive sanitization inside <template> content when using DOM output modes Fixed in 3.4.8.
- CVE-2026-49458 MODERATE: DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checks Fixed in 3.4.6.
- CVE-2026-49459 MODERATE: DOMPurify: IN_PLACE mode preserves attributes of a clobbered root element, allowing XSS via attacker-controlled root DOM Fixed in 3.4.6.
- CVE-2026-49978 MODERATE: DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content Fixed in 3.4.7.
- CVE-2026-65899 LOW: DOMPurify: Trusted Types policy survives `clearConfig()` and can poison later `RETURN_TRUSTED_TYPE` output Fixed in 3.4.9.
- CVE-2026-65901 LOW: DOMPurify: `IN_PLACE` mode trusts attacker-controlled `nodeName` on live non-form nodes, allowing script retention and XSS via attacker-supplied DOM objects
- CVE-2026-47423 HIGH: DOMPurify XSS via selectedcontent re-clone Fixed in 3.4.5.
- CVE-2026-41239 MODERATE: DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode Fixed in 3.4.0.
- CVE-2026-41240 MODERATE: DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix) Fixed in 3.4.0.
- CVE-2026-41238 MODERATE: DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback Fixed in 3.4.0.
- CVE-2026-65903 MODERATE: DOMPurify's ADD_TAGS function form bypasses FORBID_TAGS due to short-circuit evaluation Fixed in 3.4.0.
- CVE-2026-65913 MODERATE: DOMPurify USE_PROFILES prototype pollution allows event handlers Fixed in 3.3.2.
- CVE-2026-65912 MODERATE: DOMPurify ADD_ATTR predicate skips URI validation Fixed in 3.3.2.
- CVE-2026-65914 MODERATE: DOMPurify is vulnerable to mutation-XSS via Re-Contextualization  Fixed in 3.3.2.
- CVE-2026-0540 MODERATE: DOMPurify contains a Cross-site Scripting vulnerability Fixed in 3.3.2, 2.5.9.
- CVE-2025-15599 MODERATE: DOMPurify contains a Cross-site Scripting vulnerability Fixed in 3.2.7.
- CVE-2025-26791 MODERATE: DOMPurify allows Cross-site Scripting (XSS) Fixed in 3.2.4.
- CVE-2024-48910 CRITICAL: DOMPurify vulnerable to tampering by prototype polution Fixed in 2.4.2.
- CVE-2024-47875 HIGH: DOMpurify has a nesting-based mXSS Fixed in 2.5.0, 3.1.3.
- CVE-2024-45801 HIGH: DOMPurify allows tampering by prototype pollution Fixed in 2.5.4, 3.1.3.
- CVE-2019-25155 MODERATE: DOMPurify Open Redirect vulnerability Fixed in 1.0.11.
- CVE-2020-26870 MODERATE: Cross-site Scripting in dompurify Fixed in 2.0.17.
- GHSA-mjjq-c88q-qhr6 CRITICAL: Cross-Site Scripting in dompurify Fixed in 2.0.7.
- CVE-2019-16728 MODERATE: Cross-Site Scripting in dompurify Fixed in 2.0.3.

Sources: npm, deps.dev (CC BY 4.0), OSV. Last checked 4 Dec 2026.
