Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
Published: 2026-07-08
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Mistune, a Python Markdown parser, allows unescaped HTML class values from the :class: option of its Admonition directive to be concatenated directly into rendered HTML. This missing escaping creates a classic input validation flaw (CWE-79) that lets an attacker inject arbitrary HTML attributes, such as JavaScript event handlers, into the page. The malicious script runs in the context of the user’s browser, enabling session hijacking, data theft or defacement when the rendered markdown is displayed. The vulnerability is only exploitable where user‑supplied markdown is rendered and delivered to a browser.

Affected Systems

The flaw impacts any application that incorporates the Mistune parser from lepture, version older than 3.2.1, and renders Markdown containing the Admonition directive. If the directive is not disabled or the :class: option is not filtered, user‑supplied content can inject arbitrary HTML attributes. Open‑source projects and other software that depend on Mistune directly or indirectly are potential targets, but only those that use the vulnerable directive in a context that displays the rendered HTML.

Risk and Exploitability

The CVSS score of 5.3 places the flaw in the moderate range, but exploitation is straightforward, requiring only crafted markdown. No additional privileges or network access are necessary beyond the ability to supply or influence the markdown content. The EPSS score of <1% indicates a very low probability of exploitation. Based on the description, it is inferred that the attack likely occurs in an HTTP context where the rendered markdown is delivered to a browser, resulting in client‑side code execution. The vulnerability is not listed in the CISA KEV catalogue.

Generated by OpenCVE AI on July 26, 2026 at 17:26 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Mistune to version 3.2.1 or later where the :class: option is properly escaped.
  • If an upgrade is not yet possible, disable the Admonition directive or strip the :class: option from user‑supplied markdown before rendering.
  • Configure downstream applications to sanitize or whitelist only safe HTML attributes after rendering to further mitigate injection risk.

Generated by OpenCVE AI on July 26, 2026 at 17:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-g97x-gvcm-x72h Mistune: XSS via unescaped class option in Admonition directive
History

Fri, 10 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

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

threat_severity

Moderate


Wed, 08 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 08 Jul 2026 17:45:00 +0000

Type Values Removed Values Added
First Time appeared Lepture
Lepture mistune
Vendors & Products Lepture
Lepture mistune

Wed, 08 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Description Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
Title Mistune: XSS via unescaped class option in Admonition 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:L/VI:L/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-08T19:40:52.229Z

Reserved: 2026-07-07T18:20:06.126Z

Link: CVE-2026-59926

cve-icon Vulnrichment

Updated: 2026-07-08T17:48:33.163Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-08T16:16:15Z

Links: CVE-2026-59926 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-26T17:30:17Z

Weaknesses
  • CWE-79

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