Advisory

GHSA-wvhx-q427-fgh3

Also known as: CVE-2024-34078, PYSEC-2026-1455

Summary

Arbitrary HTML present after sanitization because of unicode normalization

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2024-05-06 14:33 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

html-sanitizer

PyPI · All systems

Affected

  • introduced 0, fixed 2.4.2 (ecosystem)

Fixed versions

2.4.2

Fix

  • Fixed version 2.4.2
    pip install --upgrade html-sanitizer==2.4.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences