Impact
The vulnerability arises from Mistune's image directive plugin accepting width or height parameters that begin with numeric values but allow additional characters. The plugin inserts these values directly into a style attribute without escaping. Consequently any CSS appended after the numeric prefix is rendered verbatim, allowing an attacker to inject arbitrary CSS into the resulting image element.
Affected Systems
Any Python application that imports Mistune prior to version 3.2.1 and uses the image directive plugin is affected. The vendor is Lepture, product Mistune. All releases before 3.2.1 are susceptible.
Risk and Exploitability
The CVSS score of 4.7 indicates a moderate impact. EPSS is not available and the vulnerability is not listed in CISA KEV. Exploitation is straightforward: by supplying crafted Markdown containing an image directive with a malicious width or height value, an attacker can cause the parser to output an image element with a style attribute that contains injected CSS. The flaw can be triggered remotely through any user‑supplied Markdown processed by the vulnerable parser, requiring no additional privileges. The potential damage is confined to client‑side page rendering and may affect confidentiality, integrity, or availability of the user’s browser context. Based on the description, it is inferred that cross‑site scripting could be possible when combined with other browser features, but this is not explicitly confirmed.
OpenCVE Enrichment
Github GHSA