Vulnerability · Published May 6, 2024 · Assigned by GitHub_M

CVE-2024-34078html-sanitizer allows arbitrary HTML present after sanitization because of unicode normalization

Medium 6.1

In plain English

A medium-severity cross-site scripting in html-sanitizer from matthiask. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 47% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)6.1Medium
Exploit odds (30 days)0.6%top 53.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

html-sanitizer is an allowlist-based HTML cleaner. If using `keep_typographic_whitespace=False` (which is the default), the sanitizer normalizes unicode to the NFKC form at the end. Some unicode characters normalize to chevrons; this allows specially crafted HTML to escape sanitization. The problem has been fixed in 2.4.2.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIhtml-sanitizer2.4.2GHSA-wvhx-q427-fgh3
PyPIhtml-sanitizer2.4.2PYSEC-2026-1455
Ubuntu:22.04:LTSpython-html-sanitizerno fix listedUBUNTU-CVE-2024-34078
Ubuntu:24.04:LTSpython-html-sanitizerno fix listedUBUNTU-CVE-2024-34078

Affected products (as reported)

VendorProductVersions
matthiask html-sanitizer < 2.4.2

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

References