Skip to content
Heist/ feed
Back to feed
LowFix available

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

Type: advisorySources: OSV

## Environment - dompurify 3.4.15 (current npm release); reproduced independently on jsdom 30.0.1 and 29.1.1 (Node.js 20.x / 26.x) - Config: `DOMPurify.sanitize(node, { IN_PLACE: true })` on a Node input; `SAFE_FOR_XML` at its default (`true`) ## Summary The 3.4.9 fix for the IN_PLACE detached-root class added two protections on the IN_PLACE return path: a fail-closed `TypeError` in `_forceRemove` when a node selected for removal cannot be detached, and a `_neutralizeSubtree` pass (`dist/purify.js` line 1336) that strips non-allowlisted **attributes** from removed subtrees. Both miss the rawtext **text-content** form. When the force-removed root is a rawtext element (`'; // text payload window.document.body.appendChild(styleRoot); const returned = DOMPurify.sanitize(styleRoot, { IN_PLACE: true }); console.log(returned === styleRoot); // true (same node) console.log(styleRoot.parentNode === null); // true (detached) console.log(styleRoot.outerHTML); // console.log(styleRoot.getAttribute('onclick')); // null (attribute neutralized) console.log(styleRoot.textContent); // '' (text survives) // plain HTML reparse (no foreign-content context involved): const probe = window.document.createElement('div'); probe.innerHTML = returned.outerHTML || styleRoot.outerHTML; console.log(probe.querySelectorAll('img').length); // 1 console.log(probe.querySelector('img').getAttribute('onerror')); // "1" ``` Observed on 3.4.15: one node, one call — the `onclick` **attribute** is neutralized while

Products
dompurify
Affected versions
Not specified
Fixed versions
3.4.16
CVEs
CVE-2026-109345
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:56 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 5 Oct 2026, 23:43 UTC

## Environment - dompurify 3.4.15 (current npm release); reproduced independently on jsdom 30.0.1 and 29.1.1 (Node.js 20.x / 26.x) - Config: `DOMPurify.sanitize(node, { IN_PLACE: true })` on a Node input; `SAFE_FOR_XML` at its default (`true`) ## Summary The 3.4.9 fix for the IN_PLACE detached-root class added two protections on the IN_PLACE return path: a fail-closed `TypeError` in `_forceRemove` when a node selected for removal cannot be detached, and a `_neutralizeSubtree` pass (`dist/purify.js` line 1336) that strips non-allowlisted **attributes** from removed subtrees. Both miss the rawtext **text-content** form. When the force-removed root is a rawtext element (`'; // text payload window.document.body.appendChild(styleRoot); const returned = DOMPurify.sanitize(styleRoot, { IN_PLACE: true }); console.log(returned === styleRoot); // true (same node) console.log(styleRoot.parentNode === null); // true (detached) console.log(styleRoot.outerHTML); // console.log(styleRoot.getAttribute('onclick')); // null (attribute neutralized) console.log(styleRoot.textContent); // '' (text survives) // plain HTML reparse (no foreign-content context involved): const probe = window.document.createElement('div'); probe.innerHTML = returned.outerHTML || styleRoot.outerHTML; console.log(probe.querySelectorAll('img').length); // 1 console.log(probe.querySelector('img').getAttribute('onerror')); // "1" ``` Observed on 3.4.15: one node, one call — the `onclick` **attribute** is neutralized while

osv:GHSA-6688-9rhm-gjv2

dompurify

Fixed versions: 3.4.16

Complete source record
{
  "id": "c0670db99229a42bd3ceb98dd7d4b8ebdfbd115c350f7220d28a2c7e14fb162b",
  "url": "https://osv.dev/vulnerability/GHSA-6688-9rhm-gjv2",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executes",
    "summary": "## Environment - dompurify 3.4.15 (current npm release); reproduced independently on jsdom 30.0.1 and 29.1.1 (Node.js 20.x / 26.x) - Config: `DOMPurify.sanitize(node, { IN_PLACE: true })` on a Node input; `SAFE_FOR_XML` at its default (`true`) ## Summary The 3.4.9 fix for the IN_PLACE detached-root class added two protections on the IN_PLACE return path: a fail-closed `TypeError` in `_forceRemove` when a node selected for removal cannot be detached, and a `_neutralizeSubtree` pass (`dist/purify.js` line 1336) that strips non-allowlisted **attributes** from removed subtrees. Both miss the rawtext **text-content** form. When the force-removed root is a rawtext element (`'; // text payload window.document.body.appendChild(styleRoot); const returned = DOMPurify.sanitize(styleRoot, { IN_PLACE: true }); console.log(returned === styleRoot); // true (same node) console.log(styleRoot.parentNode === null); // true (detached) console.log(styleRoot.outerHTML); // console.log(styleRoot.getAttribute('onclick')); // null (attribute neutralized) console.log(styleRoot.textContent); // '' (text survives) // plain HTML reparse (no foreign-content context involved): const probe = window.document.createElement('div'); probe.innerHTML = returned.outerHTML || styleRoot.outerHTML; console.log(probe.querySelectorAll('img').length); // 1 console.log(probe.querySelector('img').getAttribute('onerror')); // \"1\" ``` Observed on 3.4.15: one node, one call — the `onclick` **attribute** is neutralized while ",
    "evidence": "osv:GHSA-6688-9rhm-gjv2",
    "products": [
      {
        "name": {
          "value": "dompurify",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.4.16",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "low",
    "structured": {
      "id": "GHSA-6688-9rhm-gjv2",
      "aliases": [
        "CVE-2026-109345",
        "GHSA-6688-9rhm-gjv2"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.4.16"
                }
              ]
            }
          ],
          "package": {
            "name": "dompurify",
            "purl": "pkg:npm/dompurify",
            "ecosystem": "npm"
          },
          "database_specific": {
            "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-6688-9rhm-gjv2/GHSA-6688-9rhm-gjv2.json",
            "last_known_affected_version_range": "<= 3.4.15"
          }
        }
      ],
      "modified": "2026-10-13T02:56:32.032824370Z",
      "provider": "osv",
      "references": [
        "https://github.com/cure53/DOMPurify/security/advisories/GHSA-6688-9rhm-gjv2",
        "https://github.com/cure53/DOMPurify/pull/1636",
        "https://github.com/cure53/DOMPurify/commit/b9b9d80f7e401771c2ccaef5f45def7eec8f27d7",
        "https://github.com/cure53/DOMPurify",
        "https://github.com/cure53/DOMPurify/releases/tag/3.4.16"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "severity": "LOW",
        "github_reviewed": true,
        "nvd_published_at": null,
        "github_reviewed_at": "2026-10-05T23:43:53Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-109345",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/database_specific/severity"
  },
  "source_id": "core-osv",
  "document_id": 307157,
  "published_at": "2026-10-05T23:43:53+00:00"
}