CVE-2024-34078: Arbitrary HTML present after sanitization because of unicode normalization
Impact If using keeptypographicwhitespace=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. Patches The problem has been fixed in 2.4.2. Workarounds Set keeptypographicwhitespace=True explicitly, or normalize to NFKC yourself earlier.
Published May 6, 2024
Affected packages
html-sanitizer
- Ecosystem
- PyPI
- Affected
- < 2.4.2
- Fixed in
- 2.4.2
- Check
pip show html-sanitizer
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
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.
Patches
The problem has been fixed in 2.4.2.
Workarounds
Set keep_typographic_whitespace=True explicitly, or normalize to NFKC yourself earlier.
Credited to yzueger.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
