Packages

dompurify

3.5.0 · 22 Nov 2026(MPL-2.0 OR Apache-2.0)106.1M / weekRepositorynpmAtom feed

Upgrading dompurify From 2.4.2 to 3.5.0

69 releases in betweenevery note read

Other targets from 2.4.2Newest 2.x2.5.9Clears its 21 advisories3.4.17
  1. 2.4.2yours
  2. 17 releases
  3. 3.0.0major
  4. 12 releases
  5. 3.1.1security
  6. 1 release
  7. 3.1.3security
  8. 10 releases
  9. 3.2.6security
  10. 3 releases
  11. 3.3.2security
  12. 1 release
  13. 3.4.0security
  14. 3.4.1security
  15. 1 release
  16. 3.4.3security
  17. 15 releases
  18. 3.5.0target

Before you upgrade

Tick each one off as you go
  • Breaking3.4.18
  • Breaking3.4.7
  • Breaking3.4.1

Security

Fixes 21 advisories affecting 2.4.2

  • This release contains security fixes and a few behavior changes, see below.

    3.5.0
  • Fixed the template regexes to be more robust against ReDoS attacks, thanks @aleung27

    3.4.3
  • 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.1
  • Fixed a prototype pollution via CUSTOM_ELEMENT_HANDLING, thanks @trace37labs

    3.4.0
  • Fixed an issue with USE_PROFILES prototype pollution, thanks @christos-eth

    3.4.0
  • Fixed a prototype pollution issue when working with custom elements, thanks @christos-eth

    3.3.2
  • Added better config hardening against prototype pollution, thanks @EffectRenan

    3.2.6
  • Removed the script that caused the fake entry CVE-2025-48050

    3.2.6
  • Added better hardening against Prototype Pollution attacks, thanks @kevin-mizu

    3.1.3
  • Please also note that further releases may follow as the underlying vulnerability is apparently new and further variations may be discovered.**

    3.1.1

Release by release

  1. 3.5.0

    Security fix22 Nov 20262 new · 8 fixes
    • Security

      This release contains security fixes and a few behavior changes, see below.

    • New

      Added in-depth hardening against clobbering for IN_PLACE

    • New

      Added regression tests for all of the above

    • Fixed

      Fixed a further SAFE_FOR_TEMPLATES bypass where nested tags could reassemble expressions on reparse, thanks @e1abrador

  2. 3.4.18

    Migration needed14 Nov 20261 new · 3 fixes
    • Breaking

      Removed several entries from the SVG tag allow-list that are attributes and not elements, thanks @hackvertor

    • New

      Added a console warning when USE_PROFILES is combined with ALLOWED_TAGS or ALLOWED_ATTR, thanks @rugk

    • Fixed

      Fixed a SAFE_FOR_TEMPLATES bypass where the final scrub cut through tags and let a template expression form on reparse, thanks @e1abrador

    • Fixed

      Fixed a direct property read in the clobbering check, thanks @trace37labs

    • Fixed

      Fixed a hook-widened allow-list carrying over when the config object received by a hook was passed back to sanitize()

  3. 3.4.17

    12 Oct 20261 new · 3 fixes
    • New

      Added a purify-edge test runner as a compatibility check, thanks @anzal1

    • Fixed

      Fixed an issue with IN_PLACE, SAFE_FOR_TEMPLATES and shadow roots, thanks @manus-pi

    • Fixed

      Fixed IN_PLACE handling of nodes that hooks or custom elements tough during sanitization, thanks @uttej-badwane

    • Fixed

      Fixed the SMIL attributeName guard in XHTML mode, thanks @Koukyosyumei

  4. 3.4.16

    23 Sep 20263 fixes
    • Fixed

      Fixed a problem with IN_PLACE node removal when working with hooks, thanks @manus-pi

    • Fixed

      Fixed a problem with IN_PLACE sanitization and raw-text roots, thanks @h-t-m

    • Fixed

      Fixed a problem with ESM default exports landing in CommonJS declarations, thanks @ssi02014

  5. 3.4.15

    6 Sep 20262 new
    • New

      Added better clobbering hardening when XML content is involved, thanks @gnyselcuk

    • New

      Added several smaller hardening and edge-case improvements, thanks @leechristensen

  6. 3.4.14

    19 Aug 20261 new · 2 fixes
    • New

      Added the SVG pointer-events and vector-effect presentation 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

  7. 3.4.13

    3 Aug 20263 fixes
    • Fixed

      Fixed an issue with hook removal during IN_PLACE sanitization, thanks @koyokr

    • Fixed

      Fixed an issue with hooks potentially bypassing the clone guard, thanks @AkshayjainG

    • Fixed

      Fixed an issue with DOM clobbering via ownerDocument during IN_PLACE, thanks @AkshayjainG

  8. 3.4.12

    11 Jul 20261 new · 1 fix
    • 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

82 other lines we could not sort, mostly version bumps
  • Reworked the CI setup: one always-on workflow with a single required check, a read-only build job for the SLSA provenance, and a check that the tagged dist/ matches a clean build

    3.5.0
  • Extended the Sigstore signatures to all four bundles covered by the provenance

    3.5.0
  • Updated the README, SECURITY.md and wiki

    3.5.0
  • Updated several dependencies

    3.5.0
  • SAFE_FOR_TEMPLATES is guaranteed for string input. For DOM node input and IN_PLACE it is best effort, because a tree the HTML parser did not build can change shape when it is parsed again

    3.5.0
  • A name passing CUSTOM_ELEMENT_HANDLING.tagNameCheck is only kept in HTML. Inside SVG or MathML it is not a custom element and is now removed

    3.5.0
  • When a DOM node is passed in, a textarea or title holding an element child and a void element holding children are removed. The HTML parser never produces these, so string input is not affected

    3.5.0
  • A sanitize() call made from a hook no longer changes how the rest of the outer call behaves. Code that relied on the old side effect needs to pass the config explicitly

    3.5.0
  • IN_PLACE now throws when a hook or custom element keeps putting a removed node back, instead of returning the node or running indefinitely

    3.5.0
  • Refactored the code base: removed dead code and redundant helpers, shortened comments

    3.4.18

6 internal lines (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.