unstale

npm / dompurify

dompurify

What changed in dompurify 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

3 breaking48 security1 performance3 behavior and defaults1 tooling13 fixes and other

dompurify 369 changes

Breaking changes 3

  • The function form of ADD_TAGS no longer bypasses FORBID_TAGS.

    3.4.0release notes

  • The default forbidden-content list was extended, affecting which content DOMPurify blocks by default.

    3.3.1release notes

  • The ESM import syntax was corrected, so developers may need to update their imports.

    3.3.1release notes

Security 48

  • Fixed the SMIL attributeName guard in XHTML mode.

    3.4.17release notes

  • Hardened smaller edge cases involving isValidAttribute().

    3.4.17release notes

  • Hardened smaller edge cases involving literal-text elements.

    3.4.17release notes

  • Hardened smaller namespace-related edge cases.

    3.4.17release notes

  • Fixed node removal with IN_PLACE when hooks are used.

    3.4.16release notessecurity advisory

  • Fixed IN_PLACE sanitization for raw-text roots.

    3.4.16release notessecurity advisory

  • Added several smaller hardening and edge-case improvements.

    3.4.15release notes

  • Improved clobbering hardening when XML content is involved.

    3.4.15release notes

  • Fixed possible bypasses when risky tags are allow-listed.

    3.4.14release notes

  • Fixed hooks potentially bypassing the clone guard.

    3.4.13release notes

  • Fixed hook removal during IN_PLACE sanitization.

    3.4.13release notessecurity advisory

  • Fixed DOM clobbering through ownerDocument during IN_PLACE sanitization.

    3.4.13release notes

  • Handling of declarative partial updates was hardened.

    3.4.12release notes

  • Hooks are now called for custom elements.

    3.4.12release notessecurity advisory

  • Handling of hooks that remove elements was hardened.

    3.4.12release notes

  • Fixed a leaky configuration issue affecting hooks configured through setConfig.

    3.4.11release notessecurity advisory

  • DOMPurify: Trusted Types policy survives clearConfig() and can poison later RETURN_TRUSTED_TYPE output

    3.4.9security advisory

  • DOMPurify: SAFE_FOR_TEMPLATES bypass - template expressions survive sanitization inside <template> content when using DOM output modes

    3.4.8security advisory

  • Fixed the node iterator for better template scrubbing.

    3.4.8release notes

  • Removed a problem that could lead to permanent hook pollution.

    3.4.7release notessecurity advisory

  • Hardened Shadow Root handling when using IN_PLACE.

    3.4.7release notessecurity advisory

  • DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound instanceof checks

    3.4.6security advisory

  • DOMPurify: IN_PLACE mode preserves attributes of a clobbered root element, allowing XSS via attacker-controlled root DOM

    3.4.6security advisory

  • Fixed several DOM Clobbering issues when using IN_PLACE mode.

    3.4.6release notes

  • Hardened checks for cross-realm IN_PLACE usage and Shadow DOM sanitization.

    3.4.6release notes

  • Fixed a bypass caused by the new HTML element selectedcontent introduced in 3.4.4; upgrade immediately because this is a security release.

    3.4.5release notessecurity advisory

  • Made template regexes more robust against ReDoS attacks.

    3.4.3release notes

  • Fixed URI validation for attributes allowed through the ADD_ATTR callback.

    3.4.2release notes

  • The annotation-xml check now handles mixed-case variants in XHTML mode, preventing bypass of basic custom-element exclusion.

    3.4.1release notes

  • Permissive custom-element handling now correctly strips on-handlers from HTML-spec-reserved custom element names.

    3.4.1release notes

  • The root-node check now guards against non-string nodeName values to improve DOM-clobbering robustness.

    3.4.1release notes

  • ADD_ATTR function configuration no longer leaks into subsequent array-based calls.

    3.4.0release notes

  • ADD_ATTR predicates now perform URI validation instead of skipping it.

    3.4.0release notes

  • ADD_TAGS function configuration no longer leaks into subsequent array-based calls.

    3.4.0release notes

  • An issue involving closing tags that could enable mXSS was fixed.

    3.4.0release notes

  • DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)

    3.4.0security advisory

  • DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode

    3.4.0security advisory

  • DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback

    3.4.0security advisoryrelease notes

  • DOMPurify's ADD_TAGS function form bypasses FORBID_TAGS due to short-circuit evaluation

    3.4.0security advisory

  • FORBID_TAGS now takes precedence over ADD_TAGS when both configure allowed and forbidden tags.

    3.4.0release notes

  • An issue that could enable mXSS through Re-Contextualization was fixed.

    3.4.0release notes

  • SAFE_FOR_TEMPLATES scrubbing now also applies when using the RETURN_DOM path.

    3.4.0release notes

  • Fixed a prototype pollution issue when working with custom elements.

    3.3.2release notes

  • DOMPurify ADD_ATTR predicate skips URI validation

    3.3.2security advisory

  • DOMPurify contains a Cross-site Scripting vulnerability

    2.5.9, 3.3.2security advisory

  • DOMPurify is vulnerable to mutation-XSS via Re-Contextualization

    3.3.2security advisory

  • DOMPurify USE_PROFILES prototype pollution allows event handlers

    3.3.2security advisoryrelease notes

  • Fixed a possible bypass caused by faulty raw-text tag parsing in jsdom.

    2.5.9, 3.3.2release notesrelease notes

Performance 1

  • Improved sanitizer performance by hoisting mXSS probe regexes and testing textContent before innerHTML.

    3.4.10release notes

Behavior and default changes 3

  • Added the SVG pointer-events presentation attribute to the allow-list.

    3.4.14release notes

  • Added the SVG vector-effect presentation attribute to the allow-list.

    3.4.14release notes

  • Support was added for a few new SVG attributes.

    3.4.12release notes

Tooling 1

  • Added a deterministic micro-benchmark harness with a comparison mode for evaluating performance changes.

    3.4.10release notes

Fixes and other changes 13

  • Fixed IN_PLACE handling of nodes that hooks or custom elements tough during sanitization.

    3.4.17release notes

  • Fixed an issue involving IN_PLACE, SAFE_FOR_TEMPLATES and shadow roots during sanitization.

    3.4.17release notes

  • Fixed ESM default exports appearing in CommonJS declarations.

    3.4.16release notes

  • Fixed edge cases involving mixed document contexts.

    3.4.14release notes

  • Handling of IN_PLACE sanitization was further improved.

    3.4.9release notes

  • Handling of Trusted Types config options was further improved.

    3.4.9release notes

  • Fixed an issue with handling of Trusted Types policies.

    3.4.8release notes

  • Improved handling of nested Shadow DOM trees and related iteration issues.

    3.4.3release notes

  • Fixed source maps that referred to non-existing files.

    3.4.2release notes

  • Repeated sanitization no longer repeatedly prefixes already-prefixed id and name values.

    3.4.1release notes

  • Several minor MathML attribute handling problems and typos were fixed.

    3.4.0release notes

  • Fixed a Node 20 engine requirement that caused hiccups.

    3.3.3release notes

  • Fixed lenient config parsing in _isValidAttribute.

    3.3.2release notes