dompurify
3.5.0 · 22 Nov 2026(MPL-2.0 OR Apache-2.0)106.1M / weekRepositorynpmAtom feed
3.5.0 is the newest release of 3.x.
In short
1 removed1 security1 new4 fixed1 changed
- Removed
Removed a duplicate
slotentry from the default HTML attribute allow-list - Security
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
Security
13 advisories affect 3.4.1; 3.4.17 fixes them
- ModerateDOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSSGHSA-55q2-fjhq-7xh7 · 7 Aug 2026Fixed in 3.4.13
- ModerateDOMPurify: Permanent `ALLOWED_ATTR` pollution via `setConfig()` bypassing the hook clone-guard (incomplete fix of the 3.4.7 hook-pollution patch)GHSA-cmwh-pvxp-8882 · 18 Jun 2026Fixed in 3.4.11
- ModerateDOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.contentGHSA-rp9w-3fw7-7cwq · 15 Jun 2026Fixed in 3.4.7
- ModerateDOMPurify: Hook mutation of `data.allowedTags` / `data.allowedAttributes` permanently pollutes `DEFAULT_ALLOWED_TAGS` / `DEFAULT_ALLOWED_ATTR`GHSA-76mc-f452-cxcm · 15 Jun 2026Fixed in 3.4.7
- ModerateDOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checksGHSA-hpcv-96wg-7vj8 · 15 Jun 2026Fixed in 3.4.6
8 more
- ModerateDOMPurify: IN_PLACE mode preserves attributes of a clobbered root element, allowing XSS via attacker-controlled root DOMGHSA-r47g-fvhr-h676 · 15 Jun 2026Fixed in 3.4.6
- LowDOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed (incomplete fix for GHSA-p98j-92pf-mc4p)GHSA-mrv2-3pqr-j5jr · 22 Oct 2026Fixed in 3.4.17
- LowDOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xmlGHSA-c6gr-qvv4-5v3f · 22 Oct 2026Fixed in 3.4.17
- LowDOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executesGHSA-6688-9rhm-gjv2 · 5 Oct 2026Fixed in 3.4.16
- LowDOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.GHSA-c2j3-45gr-mqc4 · 21 Jul 2026Fixed in 3.4.12
- LowDOMPurify: Trusted Types policy survives `clearConfig()` and can poison later `RETURN_TRUSTED_TYPE` outputGHSA-vxr8-fq34-vvx9 · 15 Jun 2026Fixed in 3.4.9
- LowDOMPurify: SAFE_FOR_TEMPLATES bypass - template expressions survive sanitization inside <template> content when using DOM output modesGHSA-gvmj-g25r-r7wr · 15 Jun 2026Fixed in 3.4.8
- LowDOMPurify: `IN_PLACE` mode trusts attacker-controlled `nodeName` on live non-form nodes, allowing script retention and XSS via attacker-supplied DOM objectsGHSA-x4vx-rjvf-j5p4 · 15 Jun 2026Fixed in 3.4.7
Release note
Fixed an issue with on-handler stripping for HTML-spec-reserved custom element names (
font-face,color-profile,missing-glyph,font-face-src,font-face-uri,font-face-format,font-face-name) under permissiveCUSTOM_ELEMENT_HANDLINGFixed a case-sensitivity gap in the
annotation-xmlcheck that allowed mixed-case variants to bypass the basic-custom-element exclusion in XHTML modeFixed
SANITIZE_NAMED_PROPSrepeatedly prefixing already-prefixedidandnamevalues on subsequent sanitizationFixed the
IN_PLACEroot-node check to explicitly guard against non-stringnodeName(DOM-clobbering robustness)- Removed
Removed a duplicate
slotentry from the default HTML attribute allow-list - Security
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 Added regression and pinning tests covering the above fixes and two accepted-behavior contracts (
SAFE_FOR_TEMPLATESgreedy scrub, hook-added attribute handling)Extended CodeQL analysis to run on
3.xand2.xmaintenance branches
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.