CVE-2024-34078matthiask html-sanitizer
Medium 6.1 No auth needed
Follow: this CVE · matthiask · matthiask html-sanitizer We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- 0.7% probability of exploitation in 30 days · percentile 49
- Auth required
- No
- Published
- May 6, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for html-sanitizer.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | html-sanitizer |
< 2.4.2 |
2.4.2 |
pip install "html-sanitizer>=2.4.2" |
| PyPI | html-sanitizer |
< 2.4.2 |
2.4.2 |
pip install "html-sanitizer>=2.4.2" |
Per OSV / GitHub Advisories (GHSA-wvhx-q427-fgh3, PYSEC-2026-1455). Check the version in your lockfile before upgrading.
Affected products
- matthiask · html-sanitizer
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.