Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

html5lib/html5lib-python
master @ fd4f032
22
Fixes
2
CVEs
HIGH
Peak severity
23.8%
Coverage
Highlights
Cross-Site Scripting (XSS): 16 prior fixes. Scrutinize any change in this area.
src/html5lib/sanitizer.py: most-fixed (6 issues). Treat as high-risk during review.
9 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Cross-Site Scripting (XSS): The HTML sanitizer's protocol validation was repeatedly bypassed due to logic errors (e.g., using 'or' instead of 'and' for protocol filters) and failing to normalize Unicode characters before executing safety checks. This directly allowed malicious protocols like 'javascript:' to pass through.
Cross-Site Scripting (XSS): Flaws in the tokenization engine, such as improper handling of NULL characters (\u0000), backticks in unquoted attributes, and incorrect parsing of CDATA or escape state boundaries (e.g., '--x>'), allowed attackers to craft bypass vectors that alter downstream DOM parsing.
Cross-Site Scripting (XSS): The HTML serializer failed to adequately quote attribute values containing whitespace-like characters or '=' in legacy-browser-safe modes, allowing browser parser confusion to execute injected scripts.