{"id":"CVE-2026-49978","aliases":["CVE-2026-49978","GHSA-rp9w-3fw7-7cwq"],"related":[],"kind":"vulnerability","state":"published","title":"DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content","summary":"DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside <template>.content, allowing attacker-controlled markup such as event handlers, JavaScript URLs, or scripts to survive and execute when an application cloned and inserted the sanitized template. This issue is fixed in version 3.4.7.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside <template>.content, allowing attacker-controlled markup such as event handlers, JavaScript URLs, or scripts to survive and execute when an application cloned and inserted the sanitized template. This issue is fixed in version 3.4.7.","source":"cvelist"},{"lang":"en","text":"If the HTML you give it contains a <template> element, and inside that template there's an element with a shadow DOM attached to it, DOMPurify quietly skips over the shadow contents. Whatever the attacker put in there - an image with an onerror handler, a link with a javascript: URL, even a full script - survives untouched. The moment the application uses that template the way templates are meant to be used (cloning it and inserting the result into the page), the malicious payload comes along and runs as if it had never been sanitized. From there an attacker gets everything XSS normally gets them: session cookies, stored tokens, the ability to act as the user, and the ability to leave persistent payloads behind for the next person who visits.\n\n[advisory.pdf](https://github.com/user-attachments/files/28275600/advisory.pdf)\n\n[poc.html](https://github.com/user-attachments/files/28275708/poc.html)","format":"markdown","source":"ghsa"},{"lang":"es","text":"DOMPurify es un saneador de cross-site scripting exclusivo para DOM para HTML, MathML y SVG. Antes de la versión 3.4.7, el saneamiento IN_PLACE de DOMPurify podría omitir el contenido en la sombra adjunto a un elemento dentro de [template].content, permitiendo que el marcado controlado por el atacante, como controladores de eventos, URLs de JavaScript o scripts, sobreviviera y se ejecutara cuando una aplicación clonaba e insertaba la plantilla saneada. Este problema está solucionado en la versión 3.4.7.","source":"nvd"}],"published":"2026-06-15T20:01:45.000Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 3.4.6","status":"affected"}],"vendor":"cure53","product":"DOMPurify","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.4.7"}],"ecosystem":"npm","package":"dompurify","purl":"pkg:npm/dompurify","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.4.7"}],"vendor":"cure53","product":"dompurify","cpe":"cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/cure53/DOMPurify/security/advisories/GHSA-rp9w-3fw7-7cwq","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/cure53/DOMPurify/commit/ca30f070c360df162a3e3848e80e6fd3c9e74bff","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/cure53/DOMPurify/releases/tag/3.4.7","tags":["release-notes","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/cure53/DOMPurify","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-21T14:59:10.987Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49978","url":"https://www.cve.org/CVERecord?id=CVE-2026-49978","licence":"CVE Terms of Use","modified":"2026-07-21T14:59:20.582Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rp9w-3fw7-7cwq","url":"https://github.com/advisories/GHSA-rp9w-3fw7-7cwq","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:50.441Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49978","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49978","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:28.231Z","epss":{"score":0.00334,"percentile":0.28636,"date":"2026-12-01T12:00:22.000Z"}}