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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| matthiask | html-sanitizer | < 2.4.2 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 11 | python-html-sanitizer | 1.9.1-2+deb11u1 | DLA-3856-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | python-html-sanitizer | No fix yet | — |
| Ubuntu 22.04 LTS | python-html-sanitizer | No fix yet | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | html-sanitizer | < 2.4.2 | 2.4.2 | GHSA-wvhx-q427-fgh3 |
Advisories 1
- DLA-3856-1 python-html-sanitizer - security update Debian Security (DSA / DLA) · Mar 9, 2026