CVE-2026-44899
Received Received - Intake
XSS via CSS Injection in Mistune Markdown Parser

Publication date: 2026-05-26

Last updated on: 2026-05-26

Assigner: GitHub, Inc.

Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, the Image directive plugin validates the :width: and :height: options with a regex compiled as _num_re = re.compile(r"^\d+(?:\.\d*)?"). When the validated value is not a plain integer, render_block_image() inserts it directly into a style="width:...;" or style="height:...;" attribute. Because the value was accepted by the prefix-only regex, any CSS after the leading digits reaches the style= attribute verbatim and without escaping. This vulnerability is fixed in 3.2.1.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-26
Last Modified
2026-05-26
Generated
2026-05-27
AI Q&A
2026-05-27
EPSS Evaluated
N/A
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
lepture mistune 3.2.1
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in the Mistune Python Markdown parser's Image directive plugin prior to version 3.2.1. The plugin validates the :width: and :height: options using a regex that only checks for a numeric prefix. If the value is not a plain integer but starts with digits followed by additional CSS code, this extra CSS is inserted directly into the style attribute without escaping. This allows untrusted CSS to be injected into the style attribute, potentially leading to security issues.


How can this vulnerability impact me? :

The vulnerability can allow an attacker to inject arbitrary CSS into the style attributes of images rendered by Mistune. This could lead to style manipulation on web pages, potentially affecting the appearance or behavior of the site. Although the CVSS score indicates a moderate impact (4.7), the vulnerability does not directly affect confidentiality or availability but can impact the integrity of the rendered content.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability is fixed in Mistune version 3.2.1. Immediate mitigation involves upgrading the Mistune package to version 3.2.1 or later.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart