CVE-2026-44896

Mistune: XSS via unescaped figclass/figwidth in Figure directive

Published May 26, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Version 3.2.1 contains a patch.

Analysis

AI-generated

Technical impact

Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, the render_figure() function concatenates the figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Version 3.2.1 contains a patch.

Affected Systems

The vulnerability affects Lepture Mistune, version 3.2.0 and earlier, which is widely used to render Markdown content in Python web applications.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity, and the combination of user‑controlled Markdown input and the lack of escaping means that an attacker who can supply malicious figure directives can run arbitrary scripts in a victim's browser. The EPSS score is < 1%, indicating a low exploitation probability, and the vulnerability is not listed in the CISA KEV catalog, but any web application rendering user‑supplied Markdown with Mistune exposes a realistic XSS vector. The primary attack vector is a crafted Markdown document that includes a figure directive with specially crafted figclass or figwidth values.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mistune to the latest released version that includes the escape fix.
  • Disable or remove the figure directive from Markdown allowed syntax if the feature is not required.
  • Sanitize or escape user‑supplied Markdown before rendering, ensuring that figclass and figwidth values are not inserted unsafely.

Generated by OpenCVE AI on June 9, 2026 at 01:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-58cw-g322-p94v Mistune has XSS via unescaped figclass/figwidth in Figure directive
History
Type Values Removed Values Added
Description Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and realier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Version 3.2.1 contains a patch.
References
Type Values Removed Values Added
First Time appeared Mistune Project
Mistune Project mistune
CPEs cpe:2.3:a:mistune_project:mistune:*:*:*:*:*:*:*:*
Vendors & Products Mistune Project
Mistune Project mistune
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Lepture
Lepture mistune
Vendors & Products Lepture
Lepture mistune
Type Values Removed Values Added
Description Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and realier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer.
Title Mistune: XSS via unescaped figclass/figwidth in Figure directive
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 8, 2026, 11:34 PM
Reserved
May 7, 2026, 9:50 PM
Status
Modified
Published
May 26, 2026, 9:16 PM
Modified
Jul 24, 2026, 11:10 AM