Skip to main content

HtmlSanitizer CVE-2026-116538

| EUVDEUVD-2026-109908 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-10-26 VulnCheck GHSA-qw8f-hph4-7r4g
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 HTML containing second body/html tag with onload
  2. Delivery
    Application calls SanitizeDom(string)
  3. Exploit
    Wrapper-element event handler survives sanitization
  4. Execution
    Victim renders serialized document/body outer HTML
  5. Impact
    Script executes in victim's browser

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Specific conditions required: (1) the application must use the SanitizeDom(string) API path, and (2) it must serialize/render MORE of the returned document than dom.Body.ChildNodes - i.e. the full document via dom.ToHtml() or the body/html outer HTML - because the vulnerable attributes live on the wrapper elements, not inside the body content; (3) attacker input must include a second <body> or <html> start tag whose attributes (e.g. onload) merge onto the existing wrapper element per HTML5 tree construction; and (4) a victim must render that output (UI:P). Limiting factors that reduce real-world risk: callers that only emit the sanitized body inner HTML are not affected, exploitation is not attacker-controlled on a default serialization path (AT:P), victim interaction is required, and only versions before 9.2.1039 and 10.0 prereleases before 10.0.1037-beta are affected.

Impact

All severity signals point to this being a low-priority issue rather than an urgent one. The input CVSS 4.0 base score is 2.3 and the vuln.today Decision label is 'monitor' (not act_now/emergency). The 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N) shows no impact to the vulnerable system itself and only low confidentiality/integrity impact to a subsequent system (the victim's browser), which is consistent with a reflected/stored XSS. The AT:P and UI:P metrics are the key dampeners: exploitation is not fully attacker-controlled on a default path - it depends on how the consuming application uses the output (see exploitation_conditions) and on a victim rendering it. This CVE is NOT in CISA KEV, so it is not confirmed actively exploited. No EPSS score was provided in the input, so exploitation probability cannot be quantified here. A public PoC reference exists (the joshua.hu writeup and the VulnCheck advisory) but the input does not mark it as confirmed working exploit code, so it should be treated as a technical writeup, not a weaponized exploit. Net: a genuine sanitizer-bypass XSS worth patching in a normal maintenance cycle, but low real-world risk - not an emergency.

Exploit ScenarioDerived

An application calls HtmlSanitizer.SanitizeDom(string) on attacker-supplied HTML and then renders the serialized full document or the body/html outer HTML rather than only dom.Body.ChildNodes. The attacker submits input containing a second <body> or <html> start tag carrying an event handler (e.g. '<body onload=alert(1)>'); because SanitizeDom never strips attributes on the html/body wrapper elements, the onload handler survives sanitization and executes in a victim's browser when that serialized output is displayed. A public PoC reference exists (joshua.hu / VulnCheck advisory); it is not verified as working exploit code.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 26, 2026

HtmlSanitizer's SanitizeDom(string) API leaves attributes untouched on the <html> and <body> wrapper elements it parses into, so markup such as a second <body onload=alert(1)> tag can place a live event handler on the returned document. The issue affects releases before 9.2.1039 and 10.0 prereleases before 10.0.1037-beta, and only matters where the caller serializes more than dom.Body.ChildNodes - for example dom.ToHtml() or the body/html outer HTML - and where a victim then renders that output. Severity signals are low (CVSS 4.0 score 2.3; independent assessment CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N), no public exploit or CISA KEV entry is associated with the flaw at time of analysis, and the vendor has released fixed versions.

RemediationAI

Vendor-released patch: upgrade HtmlSanitizer to 9.2.1039 (or later 9.x) or to 10.0.1037-beta (or later 10.0 prerelease), per the release pages at https://github.com/mganss/HtmlSanitizer/releases/tag/v9.2.1039 and https://github.com/mganss/HtmlSanitizer/releases/tag/v10.0.1037-beta; the underlying fixes are commits 96afbc818e64de7571ea17954a05d523e819c56f and ab626e7a4f2893f7e9ec0a72779ae19c5ec439a7. If upgrading cannot be done immediately, the practical mitigation is to change how sanitized output is consumed: emit only the sanitized body inner HTML (dom.Body.ChildNodes) rather than serializing the full document with dom.ToHtml() or the body/html outer HTML, since the surviving attributes live on the wrapper elements and not inside the body content - the trade-off is that any DOCTYPE/head content your rendering depended on is dropped, and this only holds if no other code path re-serializes the outer document. Switching to the string-returning Sanitize() API avoids the affected code path at the cost of losing DOM-based post-processing such as node inspection or custom attribute handling. Because exploitation additionally requires a victim to render the crafted output (UI:R/UI:P), keep an eye on any stored-content paths where attacker HTML is later viewed by other users, but no patch-urgent action is indicated by the current intelligence.

Affected VersionsENISA

HtmlSanitizer 10.0.0-beta <10.0.1037-beta
HtmlSanitizer 0 <9.2.1039

Affected Packages

euvd htmlsanitizer fix: 9.2.1039, 10.0.1037-beta

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

HtmlSanitizer is a .NET (C#) library that cleans untrusted HTML before an application re-renders it; CWE-79 (cross-site scripting) is the relevant weakness class. The root cause is HTML5 tree construction: an <html> or <body> start tag appearing in caller input does not create a new element - its attributes are merged onto the existing wrapper element that SanitizeDom parses into. Because the internal DoSanitize routine screens only the descendants of its context node and never the context element itself or anything above it, attributes such as onload supplied by an attacker survive on the wrapper. The project's own fix comment and regression tests confirm this: the patch strips all attributes from dom.DocumentElement, dom.Head and dom.Body before sanitization through the normal RemoveAttribute path (raising RemovingAttribute events), with tests asserting that "<body onload=alert(1)><p>hi</p>" and "<html onload=alert(1)><body><p>hi</p>" normalize to a clean document. The supplied CPE (cpe:2.3:a:mganss:htmlsanitizer:*:*:*:*:*:*:*:*) covers the affected package range generically; the vulnerable code referenced in the advisory is in HtmlSanitizer.cs at lines ~456-465 and ~555-583 of v9.2.995.

Know when Htmlsanitizer 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:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.7 MEDIUM

Network input but exploitation needs the app to serialize full document/outer HTML (AC:H) and a victim to render it (UI:R); XSS runs in the browser so scope changes with low C/I impact and no availability impact.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

HtmlSanitizer before 9.2.1039 and 10.0 prereleases before 10.0.1037-beta contains a cross-site scripting vulnerability because SanitizeDom(string) never sanitizes attributes on the html and body wrapper elements. Attackers can supply input with a second body or html tag carrying event handlers like onload, executing script when applications render serialized document or body outer HTML.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
Medium
widely-used .NET HTML sanitization NuGet library, not universal
Data Quality
4 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 0.3%
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
Defer
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Low

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.

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