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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | html-sanitizer | 2.4.2 | GHSA-wvhx-q427-fgh3 |
| PyPI | html-sanitizer | 2.4.2 | PYSEC-2026-1455 |
| Ubuntu:22.04:LTS | python-html-sanitizer | no fix listed | UBUNTU-CVE-2024-34078 |
| Ubuntu:24.04:LTS | python-html-sanitizer | no fix listed | UBUNTU-CVE-2024-34078 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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