dompurify vulnerabilities

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

Registry
npm
Latest
3.4.17
License
(MPL-2.0 OR Apache-2.0)

33 known advisories

The latest version, 3.4.17, is not affected by any of them. Projects on older versions may be.

Update to the latest version:npm install dompurify@3.4.17

Security advisories for dompurify

  • CriticalGHSA-cg2g-xh64-v4q722 Oct 2026

    DOMPurify SAFE_FOR_TEMPLATES bypass: split template expressions survive in attached shadow root content on DOM output modes

    Affected
    >=3.4.4 <3.4.17
    Fixed in
    3.4.17
  • HighGHSA-mrv2-3pqr-j5jr22 Oct 2026

    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)

    Affected
    <3.4.17
    Fixed in
    3.4.17
  • LowGHSA-c6gr-qvv4-5v3f22 Oct 2026

    DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml

    Affected
    <3.4.17
    Fixed in
    3.4.17
  • LowGHSA-6688-9rhm-gjv25 Oct 2026

    DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executes

    Affected
    <3.4.16
    Fixed in
    3.4.16
  • LowGHSA-p98j-92pf-mc4p30 Sept 2026

    DOMPurify: IN_PLACE: node-removing afterSanitize hook leaves detached subtree event handlers armed, causing DOM XSS

    Affected
    >=3.4.13 <3.4.16
    Fixed in
    3.4.16
  • MediumGHSA-55q2-fjhq-7xh77 Aug 2026

    DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS

    Affected
    <3.4.13
    Fixed in
    3.4.13
  • LowGHSA-c2j3-45gr-mqc421 Jul 2026

    DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.

    Affected
    <3.4.12
    Fixed in
    3.4.12
  • MediumGHSA-cmwh-pvxp-888218 Jun 2026

    DOMPurify: Permanent `ALLOWED_ATTR` pollution via `setConfig()` bypassing the hook clone-guard (incomplete fix of the 3.4.7 hook-pollution patch)

    Affected
    <3.4.11
    Fixed in
    3.4.11
  • LowGHSA-vxr8-fq34-vvx915 Jun 2026

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

    Affected
    <3.4.9
    Fixed in
    3.4.9
  • LowGHSA-gvmj-g25r-r7wr15 Jun 2026

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

    Affected
    >=3.0.0 <3.4.8
    Fixed in
    3.4.8
  • MediumGHSA-rp9w-3fw7-7cwq15 Jun 2026

    DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content

    Affected
    <3.4.7
    Fixed in
    3.4.7
  • LowGHSA-x4vx-rjvf-j5p415 Jun 2026

    DOMPurify: `IN_PLACE` mode trusts attacker-controlled `nodeName` on live non-form nodes, allowing script retention and XSS via attacker-supplied DOM objects

    Affected
    <=3.4.6
    Fixed in
    No fix released
  • MediumGHSA-76mc-f452-cxcm15 Jun 2026

    DOMPurify: Hook mutation of `data.allowedTags` / `data.allowedAttributes` permanently pollutes `DEFAULT_ALLOWED_TAGS` / `DEFAULT_ALLOWED_ATTR`

    Affected
    <3.4.7
    Fixed in
    3.4.7
  • MediumGHSA-hpcv-96wg-7vj815 Jun 2026

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

    Affected
    <3.4.6
    Fixed in
    3.4.6
  • MediumGHSA-r47g-fvhr-h67615 Jun 2026

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

    Affected
    <3.4.6
    Fixed in
    3.4.6
  • HighGHSA-87xg-pxx2-7hvx1 Jun 2026

    DOMPurify XSS via selectedcontent re-clone

    Affected
    >=3.4.4 <3.4.5
    Fixed in
    3.4.5
  • MediumGHSA-h7mw-gpvr-xq4m22 Apr 2026

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

    Affected
    <3.4.0
    Fixed in
    3.4.0
  • MediumGHSA-crv5-9vww-q3g822 Apr 2026

    DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode

    Affected
    >=1.0.10 <3.4.0
    Fixed in
    3.4.0
  • MediumGHSA-v9jr-rg53-9pgp22 Apr 2026

    DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback

    Affected
    >=3.0.1 <3.4.0
    Fixed in
    3.4.0
  • MediumGHSA-39q2-94rc-95cp16 Apr 2026

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

    Affected
    <3.4.0
    Fixed in
    3.4.0
  • MediumGHSA-cjmm-f4jc-qw8r3 Apr 2026

    DOMPurify ADD_ATTR predicate skips URI validation

    Affected
    <3.3.2
    Fixed in
    3.3.2
  • MediumGHSA-cj63-jhhr-wcxv3 Apr 2026

    DOMPurify USE_PROFILES prototype pollution allows event handlers

    Affected
    <3.3.2
    Fixed in
    3.3.2
  • MediumGHSA-h8r8-wccr-v5f227 Mar 2026

    DOMPurify is vulnerable to mutation-XSS via Re-Contextualization

    Affected
    <3.3.2
    Fixed in
    3.3.2
  • MediumGHSA-v2wj-7wpq-c8vv3 Mar 2026

    DOMPurify contains a Cross-site Scripting vulnerability

    Affected
    >=3.1.3 <3.3.2 · >=2.5.3 <2.5.9
    Fixed in
    2.5.9, 3.3.2
  • MediumGHSA-v8jm-5vwx-cfxm3 Mar 2026

    DOMPurify contains a Cross-site Scripting vulnerability

    Affected
    >=3.1.3 <3.2.7 · >=2.5.3 <=2.5.8
    Fixed in
    3.2.7
  • MediumGHSA-vhxf-7vqr-mrjg14 Feb 2025

    DOMPurify allows Cross-site Scripting (XSS)

    Affected
    <3.2.4
    Fixed in
    3.2.4
  • CriticalGHSA-p3vf-v8qc-cwcr31 Oct 2024

    DOMPurify vulnerable to tampering by prototype polution

    Affected
    <2.4.2
    Fixed in
    2.4.2
  • HighGHSA-gx9m-whjm-85jf11 Oct 2024

    DOMpurify has a nesting-based mXSS

    Affected
    <2.5.0 · >=3.0.0 <3.1.3
    Fixed in
    2.5.0, 3.1.3
  • HighGHSA-mmhx-hmjr-r67416 Sept 2024

    DOMPurify allows tampering by prototype pollution

    Affected
    <2.5.4 · >=3.0.0 <3.1.3
    Fixed in
    2.5.4, 3.1.3
  • MediumGHSA-8hgg-xxm5-387314 Nov 2023

    DOMPurify Open Redirect vulnerability

    Affected
    <1.0.11
    Fixed in
    1.0.11
  • MediumGHSA-63q7-h895-m98218 Dec 2020

    Cross-site Scripting in dompurify

    Affected
    <2.0.17
    Fixed in
    2.0.17
  • CriticalGHSA-mjjq-c88q-qhr63 Sept 2020

    Cross-Site Scripting in dompurify

    Affected
    <2.0.7
    Fixed in
    2.0.7
  • MediumGHSA-chqj-j4fh-rw7m28 Aug 2020

    Cross-Site Scripting in dompurify

    Affected
    <2.0.3
    Fixed in
    2.0.3

Which of your client projects still run an old dompurify?

NPMscan reads the package-lock.json, yarn.lock and pnpm-lock.yaml in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other npm packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the npm registry.