Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. dompurify
  4. ›
  5. GHSA-p98j-92pf-mc4p

GHSA-p98j-92pf-mc4p: DOMPurify: IN_PLACE: node-removing afterSanitize hook leaves detached subtree event handlers armed, causing DOM XSS

September 30, 2026

In IN_PLACE mode DOMPurify sanitizes the caller’s live DOM subtree directly. To close a known hazard (GHSA-55q2-fjhq-7xh7), the library neutralizes any node a hook detaches during sanitization by stripping its subtree’s non-allow-listed attributes, but this neutralization is wired only into the beforeSanitizeElements and uponSanitizeElement hook sites. An afterSanitizeElements or afterSanitizeAttributes hook that removes a non-root element (a documented, supported pattern) detaches that element’s subtree with no neutralization, so descendant on* handlers remain armed on the caller’s live tree after sanitize() returns, yielding DOM XSS. No special privilege is required beyond supplying markup to an application that uses IN_PLACE together with a node-removing afterSanitize hook.

References

  • github.com/advisories/GHSA-p98j-92pf-mc4p
  • github.com/cure53/DOMPurify/commit/b9b9d80f7e401771c2ccaef5f45def7eec8f27d7
  • github.com/cure53/DOMPurify/pull/1636
  • github.com/cure53/DOMPurify/releases/tag/3.4.16
  • github.com/cure53/DOMPurify/security/advisories/GHSA-p98j-92pf-mc4p

Code Behaviors & Features

Detect and mitigate GHSA-p98j-92pf-mc4p with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 3.4.13 before 3.4.16

Fixed versions

  • 3.4.16

Solution

Upgrade to version 3.4.16 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/dompurify/GHSA-p98j-92pf-mc4p.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 12 Oct 2026 12:19:03 +0000.