Skip to main content

sanitize-html CVE-2026-145156

| EUVDEUVD-2026-144271 LOW
Incomplete List of Disallowed Inputs (CWE-184)
2026-12-04 VulnCheck
2.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted SVG with attributeName xlink:href:x
  2. Delivery
    Bypass allowedSchemes in non-default sanitizer config
  3. Exploit
    Payload stored/reflected as animate element
  4. Execution
    Victim clicks animated link in current Chrome
  5. Impact
    javascript: URI executes in victim session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation completeness
Exploitation Conditions

Not exploitable against default sanitize-html options - the advisory confirms default configs strip the payload. Exploitation requires a configuration that allows SVG animation: either allow-all (allowedTags:false, allowedAttributes:false) with allowedSchemes limited to http/https, or an allowlist that adds svg and animate/set plus the href, attributeName and values attributes, or the documented case-preserving SVG setup (lowerCaseTags/lowerCaseAttributeNames false) with those tags allowed - in all cases allowedSchemes must exclude javascript: (otherwise the bypass is moot). Further limiting factors: the attack needs victim user interaction (clicking the animated link) and a browser that applies the SMIL animation - the reporter confirmed current Chrome 156 applies it while Chrome 137 produced identical sanitized output but did not animate, so browser version materially affects whether script runs.

Impact

All decision signals point the same way: this is a genuine but low-priority issue, not a high-CVSS-low-risk mismatch. The vendor CVSS 4.0 base score is 2.3 (low), driven by AC:H, AT:P, UI:P and only Low confidentiality/integrity impact, and the vuln.today decision label is 'monitor'. It is not in CISA KEV (no confirmed active exploitation), and no EPSS score is provided in the input, so widespread-exploitation probability cannot be quantified here. A detailed, reporter-verified PoC is embedded in the GHSA advisory, so exploitability is proven in a lab, but real-world impact is gated by three stacking preconditions: the target app must run a non-default sanitize-html configuration that allows SVG animate/set with attributeName and values, the victim must click the animated link, and the victim's browser must actually apply the SMIL animation (current Chrome does; Chrome 137 did not). The one cross-source discrepancy worth noting is the CWE: NVD/input lists CWE-184 (Incomplete List of Disallowed Input) while the GHSA advisory lists CWE-79 (XSS) - both are defensible for this allowedSchemes-bypass and it does not change the risk picture. Net: patch on a normal maintenance cadence; treat as elevated only if you knowingly allow SVG animation elements in sanitized untrusted HTML.

Exploit ScenarioDerived

An attacker submits untrusted HTML (e.g. a comment or rich-text field) to an application that runs sanitize-html 2.17.7-2.18.1 configured to permit SVG animate/set elements. The sanitizer fails to strip an <animate> whose attributeName is 'xlink:href:x' with values='javascript:alert(1)', so the payload survives into stored/reflected output; when a victim using current Chrome clicks the animated link, the javascript: URI executes in their session. A full working PoC (Puppeteer script plus reproduction output) is published in the GHSA advisory.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 04, 2026

sanitize-html 2.17.7 through 2.18.1 lets an HTML sanitizer allowlist be bypassed when SVG animation elements are permitted: an <animate> or <set> element whose attributeName carries an extra colon (for example "xlink:href:x") survives sanitization even though href and xlink:href spellings are stripped, and a browser that applies the SMIL animation then resolves the animated link target to a javascript: URL supplied in the values attribute, running script when a victim clicks the link. Only non-default configurations are affected - the library's default options strip the payload entirely - and exploitation additionally requires victim interaction and a browser that applies the animation (reporter's Chrome 156 did; Chrome 137 produced identical sanitized output but did not animate). Exploitation has not been observed in the wild, no CISA KEV entry exists, and public PoC material accompanying the advisory provides a reference reproduction rather than verified working exploit code; priority signals are low (CVSS 4.0 score 2.3, vuln.today decision label 'monitor').

RemediationAI

Upgrade sanitize-html to 2.18.2, the vendor-released fixed version (npm install sanitize-html@2.18.2), which normalises attributeName so prefixed or multi-colon spellings that resolve to a URL attribute are handled like href/xlink:href; the fix commit is https://github.com/apostrophecms/apostrophe/commit/bd727d101de798d574196173f3cbc4f9aaedb3f7 and details are in GHSA-8g6g-w2rq-xcmc. Because only configurations that allow SVG animation are exposed, an immediate compensating control is to remove animate and set from allowedTags (and, where practical, svg and its animation attributes) in every sanitization profile - the trade-off is that legitimate SMIL animation in user-submitted SVG stops rendering, and default-option users need no change since the payload is already stripped. Keeping javascript: out of allowedSchemes remains necessary but is not sufficient on its own, as this bypass defeats exactly that check; applications that must keep SVG animation can additionally reject or filter attributeName values containing more than one colon, at the cost of hand-maintaining a validation rule the patched release already implements. Browser-side exposure varies by version, so patching the library rather than relying on client behaviour is the durable fix.

Affected VersionsENISA

sanitize-html 2.17.7 <2.18.2

Affected Packages

euvd sanitize_html fix: 2.18.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

sanitize-html is a Node.js/npm HTML sanitizer widely used to clean untrusted markup before rendering; it works through allowlists for tags, attributes and URL schemes (allowedSchemes). The flaw is classified CWE-184 (incomplete list of disallowed inputs), and the GitHub advisory cross-lists it as CWE-79 (cross-site scripting). SMIL animation elements animate/set retarget another attribute through their attributeName attribute; the earlier fix GHSA-374f-7chj-9948 removed animate/set when attributeName was exactly href or xlink:href. That check was never normalised the way a browser normalises the value: a string such as "xlink:href:x" has an extra colon, is not treated as a URL-bearing attribute by the sanitizer, and is therefore retained together with values="javascript:alert(1)". Chrome resolves the local name to xlink:href, so the anchor's href.animVal becomes javascript:alert(1) and a click executes the script. The vulnerable path depends on configuration: allow-all (allowedTags:false, allowedAttributes:false with allowedSchemes limited to http/https), an allowlist that adds svg, animate (or set), a, and the animate attributes href, attributename and values, or the documented case-preserving SVG setup (lowerCaseTags:false, lowerCaseAttributeNames:false) with those tags allowed - in every case a scheme allowlist that already excludes javascript: is what the bypass defeats. The upstream fix commit in the apostrophe monorepo also bundles unrelated Apostrophe changesets, so it is a batch release rather than an isolated one-line patch.

Know when Sanitize Html gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 2.3 LOW
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.7 MEDIUM

Remote via submitted HTML (AV:N, PR:N); AC:H because success depends on a non-default sanitizer config and a browser that applies the animation; UI:R for the click; S:C with Low C/I for script in the victim's browser.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

sanitize-html 2.17.7 before 2.18.2 contains a cross-site scripting vulnerability that allows attackers to bypass allowedSchemes by supplying SVG animation attributeName values with multiple colons. Attackers can submit markup like attributeName xlink:href:x with javascript: URLs in values, from, or to attributes, executing script when victims click the animated link.

Threat Intelligence Overview

Prevalence
High
very widely used Node/npm HTML sanitization library
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2014-125128 MEDIUM POC
6.1 Sep 08

'sanitize-html' prior to version 1.0.3 is vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS 6.1), th

CVE-2019-25225 MEDIUM POC
6.1 Sep 08

`sanitize-html` prior to version 2.0.0-beta is vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS 6.1

CVE-2024-21501 MEDIUM POC
5.3 Feb 24

Versions of the package sanitize-html before 2.12.1 are vulnerable to Information Exposure when used on the backend and

CVE-2021-26540 MEDIUM POC
5.3 Feb 08

Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the "allowedIframeHos

CVE-2021-26539 MEDIUM POC
5.3 Feb 08

Apostrophe Technologies sanitize-html before 2.3.1 does not properly handle internationalized domain name (IDN) which co

CVE-2022-25887 HIGH
7.5 Aug 30

The package sanitize-html before 2.7.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure gl

CVE-2026-40186 MEDIUM
6.1 Apr 15

Cross-site scripting (XSS) in ApostropheCMS 4.28.0 and sanitize-html 2.17.1 allows remote attackers to bypass HTML tag f

CVE-2026-113661 MEDIUM
5.4 Oct 20

Stored cross-site scripting can occur in sites using sanitize-html before 2.18.0 when a non-default allow-list permits m

CVE-2026-53606 MEDIUM
5.4 Jun 12

Cross-site scripting in sanitize-html prior to 2.17.5 allows low-privileged attackers to inject executable `javascript:`

CVE-2026-113654 MEDIUM
5.3 Oct 20

Stored cross-site scripting in sanitize-html before 2.18.0 occurs only when the sanitizer is configured with a non-defau

CVE-2026-113650 MEDIUM
5.3 Oct 20

Unbounded recursive re-sanitization in sanitize-html 2.18.0 allows remote attackers to exhaust the Node.js call stack an

CVE-2026-113657 LOW
3.7 Oct 20

sanitize-html 2.17.7 and later before 2.18.0 can bypass SMIL URL protection when an application opts into a non-default

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy