CVE-2026-44899
XSS via CSS Injection in Mistune Markdown Parser
Publication date: 2026-05-26
Last updated on: 2026-05-26
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| lepture | mistune | 3.2.1 |
Helpful Resources
Exploitability
| 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.