Highlights
Cross-Site Scripting (XSS): 3 prior fixes. Scrutinize any change in this area.
src/mistune/directives/image.py: most-fixed (3 issues). Treat as high-risk during review.
4 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): Bypasses in the HTML renderer's URL safety checks occurred because percent-encoded URL schemes (such as 'javascript:' or 'data:') were validated before being fully decoded. This allowed malicious payloads to reach critical rendering sinks.
Cross-Site Scripting (XSS): The parsing of figure and image directive options (like 'figwidth', 'width', and 'height') relied on loose regular expressions (using `match` instead of `fullmatch`). This permitted attackers to inject arbitrary CSS dimensions and malicious HTML attributes into the rendered markup.
Path Traversal: The include directive allowed arbitrary file disclosure and path traversal by reading files outside the designated source directory prior to the enforcement of canonicalization and prefix-matching checks.