Skip to content

← Actionable
Medium, CVSS 5.1amended

DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside .content

CVE-2026-49978GHSA-rp9w-3fw7-7cwq

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (dompurify 3.4.7), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS 4.0
5.1 · 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 · score source
EPSS
  • CVE-2026-49978: 0.40% estimated exploitation activity in the next 30 days; percentile 34.73 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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. advisory.pdf poc.html

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 3 · amended ·

    Amended from ghsa record GHSA-rp9w-3fw7-7cwq

  2. Revision 2 · amended ·

    Reviewed OSV alias/range/CVSS4 correction; package source scopes and original publication preserved. No customer finding resolved.

  3. Revision 1 · created ·

    Published from osv record GHSA-rp9w-3fw7-7cwq

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-49978

Advisory: DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside .content
IDs: CVE-2026-49978, GHSA-rp9w-3fw7-7cwq
Record: https://patchnext.com/advisories/cve-2026-49978 (revision 3, source checked 26 Oct 2026, 12:55 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.1)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: dompurify 3.4.7. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm dompurify: affected <= 3.4.6; fixed in 3.4.7

## Suggested inspection (read-only)
- `npm ls dompurify --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on dompurify.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-rp9w-3fw7-7cwq (OSV record GHSA-rp9w-3fw7-7cwq lists affected ranges: npm dompurify >=0 <3.4.7 (fixed))
- Verified: https://github.com/advisories/GHSA-rp9w-3fw7-7cwq (GitHub-reviewed advisory GHSA-rp9w-3fw7-7cwq lists affected ranges: npm dompurify >=0 <=3.4.6)

Commands are suggestions: review each one before running it.

Loading voting…