Impact
Mistune, a Python Markdown parser, includes a math plugin that, before version 3.2.1, inserted user‑supplied math expressions ($…$ and $$…$$) directly into the generated HTML without escaping. Even when the parser is told to escape content, the math plugin bypasses this protection, allowing an attacker to inject arbitrary HTML or script payloads that will be rendered in the victim browser. This flaw represents a classic Cross‑Site Scripting vulnerability (CWE‑79) that permits malicious code execution within the user’s browser context.
Affected Systems
The issue affects the Mistune math plugin in all releases prior to 3.2.1 from the lepture:mistune project. Any application that parses untrusted Markdown with this plugin before the upgrade is vulnerable.
Risk and Exploitability
The vulnerability carries a CVSS score of 6.1, indicating moderate severity. No EPSS score is available, and the flaw is not listed in the CISA KEV catalog. The attack vector is inferred to be remote: an attacker can supply crafted Markdown to a web application that renders it with Mistune, causing malicious scripts to execute in the context of the application’s users. Because the flaw relies solely on input handling, no privileged access or additional prerequisites are required.
OpenCVE Enrichment
Github GHSA