Cross-Site Scripting (XSS) in sanitize-html (CVE-2026-53606)
Summary
Cross-site scripting in sanitize-html (CVE-2026-53606). Risk of unauthorized operations or information disclosure. Exploitable via allowedSchemesAppliedToAttributes. Mitigation: upgrade to 2.17.5 or later.
Original description
The description as published by the source.
Summary
sanitize-html uses allowedSchemesAppliedToAttributes (default: ['href', 'src', 'cite']) to gate the naughtyHref() function that blocks dangerous URI schemes like javascript: and vbscript:. The HTML specification defines 10+ attributes that accept URIs (action, formaction, data, poster, background, ping, xlink:href, dynsrc, lowsrc), but none of these are included in the default gate list. When a developer allows any of these attributes in their configuration, javascript: URIs pass through completely unmodified, enabling XSS.
The library has zero awareness of these URI-bearing attributes — none appear anywhere in the 854-line source file (verified by grep). No warning mechanism exists, and the README provides no security guidance about expanding allowedSchemesAppliedToAttributes when allowing form or media attributes.
Severity
Exploitation requires non-default configuration: the developer must explicitly allow a non-default tag (e.g., form) AND a non-default attribute (e.g., action). Default configuration is NOT vulnerable. However, this is a common configuration pattern for CMS platforms, form builders, and rich content editors.
Affected Versions
All versions of sanitize-html from v1.18.0 (which introduced allowedSchemesAppliedToAttributes) through at least v2.17.2. The default list has been ['href', 'src', 'cite'] since introduction and has never been expanded.
Root Cause
File: index.js:329 (sanitize-ht…
Source: NIST National Vulnerability Database 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-53606 has been found in sanitize-html.
Attackers can target a specific entry point like allowedSchemesAppliedToAttributes over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.4/10.
What to do: upgrade sanitize-html to 2.17.5 or later.
If unsure, ask your IT team or search "sanitize-html CVE-2026-53606" on the vendor's site.
CVE-2026-53606 (sanitize-html) — CWE-79 / CVSS v3 5.4
Attack vector: remote (network-reachable)
Attack surface: allowedSchemesAppliedToAttributes / action / formaction / data
Patched: 2.17.5 — 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 sanitize-html. Attackers reach the vulnerable code path via allowedSchemesAppliedToAttributes.
Check the vendor advisory for the affected versions of sanitize-html. Attack surface: allowedSchemesAppliedToAttributes / action / formaction / data.
Severity: Medium (CVSS 5.4/10). Risk of unauthorized operations or information disclosure.
Update to 2.17.5.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'sanitize-html' . 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 'sanitize-html' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
sanitize-htmlを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade sanitize-html to 2.17.5ステージング環境で 2.17.5 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com