CVE-2026-47423: DOMPurify XSS via selectedcontent re-clone
Summary DOMPurify 3.4.4 allows selectedcontent by default, allowing a chain in which browsers "re-clone" an XSS payload after sanitization, effectively bypassing DOMPurify. Details The chain is as follows: 1. The browser parses the input and creates a clone from the selected 2. DOMPurify walks and sanitizes that generated clone. 3. DOMPurify reaches the original and removes selected=javascript:1 4.
Published Jun 1, 2026
Affected packages
dompurify
- Ecosystem
- npm
- Affected
- = 3.4.4
- Fixed in
- 3.4.5
- Check
npm ls dompurify
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
DOMPurify 3.4.4 allows selectedcontent by default, allowing a chain in which browsers "re-clone" an XSS payload after sanitization, effectively bypassing DOMPurify.
Details
The chain is as follows:
- The browser parses the input and creates a
<selectedcontent>clone from the selected<option> - DOMPurify walks and sanitizes that generated clone.
- DOMPurify reaches the original
<option>and removesselected=javascript:1 - The browser refreshes the
<selectedcontent>clone from the originaloption's content. - The refreshed clone is in a subtree DOMPurify already walked, which DOMPurify doesn't go back to sanitize
- The returned string contains unsanitized markup inside
<selectedcontent>.
PoC
const dirty =
'<select><button><selectedcontent></selectedcontent></button>' +
'<option selected=javascript:1>' +
'x' +
'</option></select>';
const clean = DOMPurify.sanitize(dirty);
console.log(clean);
document.body.innerHTML = clean;Observed "sanitized" output in Chromium 148/WebKit 625:
<select><button><selectedcontent>x</selectedcontent></button><option>x</option></select>After reinsertion, the browser updates the live DOM and strips the handler from the displayed clone, but the onerror has already fired:
<select><button><selectedcontent>x</selectedcontent></button><option>x</option></select>Reproduced in Chromium and WebKit, but not Safari (not yet latest WebKit) or Firefox. Will likely change with browser support for selectedcontent.
Impact
This is a default-configuration DOMPurify sanitizer bypass resulting in XSS.
Applications are impacted if they sanitize attacker-controlled HTML with DOMPurify 3.4.4 using the string-input path and then insert the returned string into the page, for example with innerHTML.
Credited to KabirAcharya.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesGHSA-c6gr-qvv4-5v3f
DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml
lowOct 22, 2026GHSA-cg2g-xh64-v4q7
DOMPurify SAFE_FOR_TEMPLATES bypass: split template expressions survive in attached shadow root content on DOM output modes
low2.3Oct 22, 2026GHSA-mrv2-3pqr-j5jr
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)
low2.3Oct 22, 2026GHSA-6688-9rhm-gjv2
DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup — pure HTML reparse executes
lowOct 5, 2026GHSA-p98j-92pf-mc4p
DOMPurify: IN_PLACE: node-removing afterSanitize hook leaves detached subtree event handlers armed, causing DOM XSS
low2.3Sep 30, 2026GHSA-55q2-fjhq-7xh7
DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS
medium5.1Aug 7, 2026
