Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in mistune 3.3.4.
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.4, inline image parsing sends nested ![ openers through precedence_scan because the no_link_before and _label_contains_link linearization guards are gated by not is_image. In src/mistune/inline_parser.py, each outer image opener can therefore search the remaining image body, while max_image_depth does not apply because the failed scans do not produce image tokens. Rendering untrusted Markdown with the default HTML renderer and no plugins can perform quadratic CPU work and keep a worker at 100 percent utilization. This issue is fixed in version 3.3.4.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| lepture | <3.3.4 | ||
| pypi: mistune | <3.3.4 | 3.3.4 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in mistune (PyPI), strongest first
Embed
A live severity badge for an advisory, README or ticket