CVE-2026-116538

HtmlSanitizer before 9.2.1039 XSS via SanitizeDom Body and HTML Attributes

Published Oct 26, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability in HtmlSanitizer allows an attacker to insert malicious event handler attributes on nested <body> or <html> tags that are not stripped during the SanitizeDom process. When such sanitized content is rendered or its outer HTML is serialized, the injected handlers execute arbitrary JavaScript in the victim’s browser. This enables script execution within the context of the site, which can lead to session hijacking, credential theft, or defacement. The flaw is a classic injection weakness (CWE‑79) and is commonly used for XSS attacks in web applications that render user‑supplied markup.

Affected Systems

The flaw exists in the mganss:HtmlSanitizer library for versions prior to 9.2.1039 and for 10.0 prereleases before 10.0.1037‑beta. Any project that references these releases and uses the SanitizeDom method to wrap user content is susceptible.

Risk and Exploitability

The CVSS base score of 2.3 reflects a low‑severity risk under the current scoring model, but the exploit is trivial once the affected method is used. Because the attack vector relies on providing crafted HTML to the sanitizer, any application that accepts unchecked user input and serializes it back to the browser is at risk. EPSS data is not available, and the vulnerability is not listed in CISA KEV. The likely attack path is an application receiving malicious markup, passing it through SanitizeDom, and rendering the result, at which point the injected event handlers fire in the victim’s browser.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade HtmlSanitizer to version 9.2.1039 or later, or to 10.0.1037‑beta or newer releases
  • Ensure that no additional <body> or <html> tags are nested in user content before sanitization, and validate or strip any attributes from these tags
  • If immediate version upgrade is not possible, customize the sanitizer or apply a secondary sanitization pass that explicitly removes attributes from <body> and <html> elements

Generated by OpenCVE AI on October 26, 2026 at 16:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Mganss
Mganss htmlsanitizer
Vendors & Products Mganss
Mganss htmlsanitizer
Type Values Removed Values Added
Description 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.
Title HtmlSanitizer before 9.2.1039 XSS via SanitizeDom Body and HTML Attributes
First Time appeared Htmlsanitizer Project
Htmlsanitizer Project htmlsanitizer
Weaknesses CWE-79
CPEs cpe:2.3:a:htmlsanitizer_project:htmlsanitizer:*:*:*:*:*:*:*:*
Vendors & Products Htmlsanitizer Project
Htmlsanitizer Project htmlsanitizer
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 2.3, 'vector': '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'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 31, 2026, 1:25 AM
Reserved
Oct 26, 2026, 2:30 PM
Status
Awaiting Analysis
Published
Oct 26, 2026, 4:17 PM
Modified
Oct 31, 2026, 2:17 AM