Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. dompurify
  4. ›
  5. CVE-2026-49458

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

June 15, 2026

DOMPurify.sanitize(node, { IN_PLACE: true }) accepts a DOM node from any same-origin realm (e.g. a node owned by an application-created iframe document), but several follow-on security checks compare the node against constructors from the parent realm. Because constructors are per-realm, instanceof HTMLFormElement, instanceof NamedNodeMap, instanceof DocumentFragment, and instanceof Element all return false for nodes belonging to the iframe’s realm. The library therefore proceeds as if the foreign-realm form is not clobberable, the foreign-realm <template>’s .content is not a document fragment, and the foreign-realm attached shadow root is not a document fragment — silently skipping the clobber/template-content/shadow-DOM sanitization branches that those checks gate. Attacker-controlled markup survives in form attributes, template content, and attached shadow roots, and executes when the application later inserts or activates the sanitized node.

References

  • github.com/advisories/GHSA-hpcv-96wg-7vj8
  • github.com/cure53/DOMPurify/security/advisories/GHSA-hpcv-96wg-7vj8
  • nvd.nist.gov/vuln/detail/CVE-2026-49458

Code Behaviors & Features

Detect and mitigate CVE-2026-49458 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.4.6

Fixed versions

  • 3.4.6

Solution

Upgrade to version 3.4.6 or above.

Impact 6.1 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-501: Trust Boundary Violation
  • CWE-693: Protection Mechanism Failure
  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/dompurify/CVE-2026-49458.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:15:52 +0000.