Cross-Site Scripting (XSS) in dompurify (CVE-2026-65914)
Summary
Cross-site scripting in dompurify (CVE-2026-65914). Risk of unauthorized operations or information disclosure. Exploitable via POST /sanitize. Mitigation: upgrade to 3.3.2 or later.
Original description
The description as published by the source.
Description
A mutation-XSS (mXSS) condition was confirmed when sanitized HTML is reinserted into a new parsing context using innerHTML and special wrappers. The vulnerable wrappers confirmed in browser behavior are script, xmp, iframe, noembed, noframes, and noscript. The payload remains seemingly benign after DOMPurify.sanitize(), but mutates during the second parse into executable markup with an event handler, enabling JavaScript execution in the client (alert(1) in the PoC).
Vulnerability
The root cause is context switching after sanitization: sanitized output is treated as trusted and concatenated into a wrapper string (for example, ... or other special wrappers) before being reparsed by the browser. In this flow, attacker-controlled text inside an attribute (for example or equivalent closing sequences for each wrapper) closes the special parsing context early and reintroduces attacker markup () outside the original attribute context. DOMPurify sanitizes the original parse tree, but the application performs a second parse in a different context, reactivating dangerous tokens (classic mXSS pattern).
PoC
- Start the PoC app:
npm install
npm start
- Open
http://localhost:3001. - Set
Wrapper en sinktoxmp. - Use payload:
">
- Click
Sanitize + Render. - Observe:
Sanitized responsestill contains the `` sequence insidealt.- The sink reparses to include ``.
alert('expoc')is triggered.…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-65914 has been found in dompurify.
Attackers can target a specific entry point like POST /sanitize over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 6.1/10.
What to do: upgrade dompurify to 3.3.2 or later.
If unsure, ask your IT team or search "dompurify CVE-2026-65914" on the vendor's site.
CVE-2026-65914 (dompurify) — CWE-79 / CVSS v3 6.1
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: POST /sanitize / innerHTML / script / xmp
Patched: 3.3.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Cross-site scripting (XSS) (CWE-79) exists in dompurify. Attackers reach the vulnerable code path via POST /sanitize without authentication.
Check the vendor advisory for the affected versions of dompurify. Attack surface: POST /sanitize / innerHTML / script / xmp.
Severity: Medium (CVSS 6.1/10). Risk of unauthorized operations or information disclosure.
Update to 3.3.2.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual POST /sanitize requests with malformed payloads or SQL meta-characters. Run grep -r 'dompurify' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'dompurify' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
dompurifyを grep し、稼働しているサービス・バージョンを把握する。 -
2Hunt for indicators of compromise detect
grep 'POST /sanitize' /var/log/nginx/access.log | grep -E '(unusual_payload|sqli_pattern)'アクセスログで
POST /sanitizeへの異常なリクエスト (不正な認証ヘッダ・SQLメタ文字)を過去 30〜90日分捜索。WAF/SIEM があれば該当パスのアラート発火履歴を確認。 -
3Apply patch patch
Upgrade dompurify to 3.3.2ステージング環境で 3.3.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 2 で見つけた異常検知の続報チェックを含めること。
-
4Post-deployment verification verify
Replay attack against POST /sanitize on staging to confirm patch closes the vectorパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 2 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-65914 node-dompurify
- Ubuntu UBUNTU-CVE-2026-65914 node-dompurify
References
- advisory disclosure@vulncheck.com
- exploit github.com
- web github.com
- web github.com