DOMPurify, Cross-realm IN_PLACE Sanitization Bypass, CVE ID: None (disclosed as zero-day) -DC-Jun2026-435

Listen to this Post

Intro

DOMPurify.sanitize(node, { IN_PLACE: true }) accepts a DOM node from any same‑origin realm (e.g., an iframe document). However multiple security checks use realm‑bound `instanceof` against the parent realm’s constructors. Because constructors are per‑realm, instanceof HTMLFormElement, instanceof NamedNodeMap, instanceof DocumentFragment, and `instanceof Element` all return `false` for foreign‑realm nodes. The library then incorrectly skips critical sanitization branches: form clobber detection, `