# CVE-2026-49978: DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content

> DOMPurify fails to sanitize shadow DOM content within templates, allowing attackers to inject malicious scripts that execute when the template is cloned.

- **Severity:** Medium 6.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Jul 2026
- **Updated:** 21 Jul 2026
- **Also known as:** CLSA-2026-1793120038, DEBIAN-CVE-2026-49978, ECHO-63b6-6bde-ad17, GHSA-rp9w-3fw7-7cwq, MINI-236v-h394-f39q, MINI-7c53-5cwx-j26v, MINI-8xm4-5vx6-cp5h, MINI-97gc-jjrw-mmjg, MINI-jc3r-9hrx-g8rj, MINI-m29x-6h7m-g96m, MINI-mfqr-c5p7-8p5f, MINI-mg2f-9hm4-h7hm, MINI-mwm8-ccrg-442w, MINI-mxf7-8fqp-h27v, MINI-pcc9-wj65-qqcp, MINI-q23x-2qhf-jwq7, MINI-rp8x-rx4r-r999, MINI-w9q7-wr6f-jmmx, MINI-x4q9-57vj-r568, MINI-x7q4-j4jq-xj76, MINI-xqvw-8g3q-5q6g, ROOT-APP-NPM-CVE-2026-49978, UBUNTU-CVE-2026-49978

## What is CVE-2026-49978?

CVE-2026-49978 is a medium-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 14 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2026-49978?

2 open source packages ship an affected version, including dompurify. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `dompurify` | npm | All versions | 3.4.7 |
| `dompurify` | npm | All versions | 3.4.7 |

Products: Cure53 Dompurify.

## How do I fix CVE-2026-49978?

Upgrade dompurify to 3.4.7 or later.

## Is CVE-2026-49978 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49978 exists.

## Other vulnerabilities in cure53 DOMPurify

- [CVE-2024-47875](https://insights.sbomify.com/CVE-2024-47875/): DOMPurify nesting-based mXSS (critical 10.0)
- [CVE-2024-48910](https://insights.sbomify.com/CVE-2024-48910/): DOMPurify vulnerable to tampering by prototype polution (critical 9.1)
- [CVE-2026-47423](https://insights.sbomify.com/CVE-2026-47423/): DOMPurify XSS via `selectedcontent` re-clone (high 8.2)
- [CVE-2024-45801](https://insights.sbomify.com/CVE-2024-45801/): Tampering by prototype polution in DOMPurify (high 7.3)
- [CVE-2026-49458](https://insights.sbomify.com/CVE-2026-49458/): DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checks (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-49978 and fix it if it is affected.

What it is: CVE-2026-49978 is a medium-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 14 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49978 exists.

Affected packages and fixed versions:
- dompurify (npm): affected all versions; fixed in 3.4.7
- dompurify (npm): affected all versions; fixed in 3.4.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-49978/ (Markdown: https://insights.sbomify.com/CVE-2026-49978/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-49978
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-49978
- OSV: https://osv.dev/vulnerability/CVE-2026-49978

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-49978/
Summaries are generated and may contain mistakes; the official description above is the record.
