dompurify
3.5.0 · 22 Nov 2026(MPL-2.0 OR Apache-2.0)106.1M / weekRepositorynpmAtom feed
Upgrading dompurify From 3.3.2 to 3.4.17
19 releases in betweenevery note read
Before you upgrade
Tick each one off as you go- Breaking3.4.7
- Breaking3.4.1
Security
Fixes 17 advisories affecting 3.3.2
- DOMPurify's ADD_TAGS function form bypasses FORBID_TAGS due to short-circuit evaluationmoderate · GHSA-39q2-94rc-95cp
- DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSSmoderate · GHSA-55q2-fjhq-7xh7
- DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executeslow · GHSA-6688-9rhm-gjv2
- DOMPurify: Hook mutation of `data.allowedTags` / `data.allowedAttributes` permanently pollutes `DEFAULT_ALLOWED_TAGS` / `DEFAULT_ALLOWED_ATTR`moderate · GHSA-76mc-f452-cxcm
- DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.low · GHSA-c2j3-45gr-mqc4
- DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xmllow · GHSA-c6gr-qvv4-5v3f
- DOMPurify: Permanent `ALLOWED_ATTR` pollution via `setConfig()` bypassing the hook clone-guard (incomplete fix of the 3.4.7 hook-pollution patch)moderate · GHSA-cmwh-pvxp-8882
- DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM modemoderate · GHSA-crv5-9vww-q3g8
- DOMPurify: SAFE_FOR_TEMPLATES bypass - template expressions survive sanitization inside <template> content when using DOM output modeslow · GHSA-gvmj-g25r-r7wr
- DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)moderate · GHSA-h7mw-gpvr-xq4m
- DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checksmoderate · GHSA-hpcv-96wg-7vj8
- 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)low · GHSA-mrv2-3pqr-j5jr
- DOMPurify: IN_PLACE mode preserves attributes of a clobbered root element, allowing XSS via attacker-controlled root DOMmoderate · GHSA-r47g-fvhr-h676
- DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.contentmoderate · GHSA-rp9w-3fw7-7cwq
- DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallbackmoderate · GHSA-v9jr-rg53-9pgp
- DOMPurify: Trusted Types policy survives `clearConfig()` and can poison later `RETURN_TRUSTED_TYPE` outputlow · GHSA-vxr8-fq34-vvx9
- DOMPurify: `IN_PLACE` mode trusts attacker-controlled `nodeName` on live non-form nodes, allowing script retention and XSS via attacker-supplied DOM objectslow · GHSA-x4vx-rjvf-j5p4
- 3.4.3
Fixed the template regexes to be more robust against ReDoS attacks, thanks @aleung27
- 3.4.1
Strengthened the fast-check fuzz harness with explicit XSS invariants, an expanded seed-payload corpus, an additional idempotence property for
SANITIZE_NAMED_PROPS, and a negative-control assertion ensuring the invariants actually fire - 3.4.0
Fixed a prototype pollution via
CUSTOM_ELEMENT_HANDLING, thanks @trace37labs - 3.4.0
Fixed an issue with
USE_PROFILESprototype pollution, thanks @christos-eth
Release by release
- New
Added a purify-edge test runner as a compatibility check, thanks @anzal1
- Fixed
Fixed an issue with
IN_PLACE,SAFE_FOR_TEMPLATESand shadow roots, thanks @manus-pi - Fixed
Fixed
IN_PLACEhandling of nodes that hooks or custom elements tough during sanitization, thanks @uttej-badwane - Fixed
Fixed the SMIL
attributeNameguard in XHTML mode, thanks @Koukyosyumei
- New
- Fixed
Fixed a problem with
IN_PLACEnode removal when working with hooks, thanks @manus-pi - Fixed
Fixed a problem with
IN_PLACEsanitization and raw-text roots, thanks @h-t-m - Fixed
Fixed a problem with ESM default exports landing in CommonJS declarations, thanks @ssi02014
- Fixed
- New
Added better clobbering hardening when XML content is involved, thanks @gnyselcuk
- New
Added several smaller hardening and edge-case improvements, thanks @leechristensen
- New
- New
Added the SVG
pointer-eventsandvector-effectpresentation attributes to the allow-list, thanks @Jaybhade - Fixed
Fixed an issue with possible bypasses when risky tags are allow-listed, thanks @AlirezaRouhbakhsh
- Fixed
Fixed a couple of edge cases with mixed document contexts, thanks @fishjojo1
- New
- Fixed
Fixed an issue with hook removal during
IN_PLACEsanitization, thanks @koyokr - Fixed
Fixed an issue with hooks potentially bypassing the clone guard, thanks @AkshayjainG
- Fixed
Fixed an issue with DOM clobbering via
ownerDocumentduringIN_PLACE, thanks @AkshayjainG
- Fixed
- New
Added support for a few new SVG attributes, thanks @cbn-falias & @Develop-KIM
- Fixed
Fixed an issue where a hook would not get called for custom elements, thanks @Rikuxx0
- New
- Fixed
Fixed an issue with a leaky config for hooks via
setConfig, thanks @trace37labs
- Fixed
- New
Added a deterministic micro-benchmark harness (
npm run bench) with a--comparemode
- New
36 other lines we could not sort, mostly version bumps
- 3.4.17
Hardened several smaller edge cases (namespaces, literal-text elements,
isValidAttribute()), thanks @artiphishell - 3.4.17
Clarified the
IN_PLACEdocumentation in the README about possible risks - 3.4.17
Updated several dependencies
- 3.4.16
Migrated from
rolluptorolldownbecause performance, thanks @ssi02014 - 3.4.16
Bumped several dependencies where possible
- 3.4.14
Conducted another refactoring run, removed dead branches and duplicated logic, flattened attribute validation
- 3.4.14
Updated the documentation in several spots, README, wiki, etc., thanks @Akokonunes
- 3.4.14
Updated several development dependencies and CI workflow actions
- 3.4.12
Hardened the handling of hooks removing elements, @mkrause-bee360
- 3.4.12
Hardened the handling of declarative partial updates
1 internal line (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.