Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the Include directive in src/mistune/directives/include.py detects only direct self-includes and not indirect cycles, allowing two markdown files that include each other to trigger unbounded recursion, raise RecursionError, and crash the rendering request. This issue is fixed in version 3.3.0.
Published: 2026-07-08
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A mutual :include: directive can create an indirect cycle between two Markdown files that reference each other. Mistune, before version 3.3.0, does not detect such cycles, leading the renderer to recurse indefinitely until the interpreter’s maximum recursion depth is reached, raising a RecursionError and terminating the rendering process. The flaw stems from inadequate cycle detection (CWE‑674), uncontrolled recursion (CWE‑755), and a possible infinite loop condition (CWE‑835).

Affected Systems

The vulnerability is present in the Mistune Python Markdown parser produced by Lepture. All releases older than 3.3.0 are susceptible; version 3.3.0 and later contain a fix that prevents recursive inclusions.

Risk and Exploitability

The CVSS score of 5.3 represents a moderate severity denial‑of‑service risk, while the EPSS score of <1% indicates a very low but non‑zero chance of exploitation in the wild. The vulnerability is not listed in the CISA KEV catalog. An attacker can exercise the flaw by supplying two Markdown files under their control, each including the other. This forces the application to continue recursive inclusion until the Python interpreter’s call stack limit is exceeded, causing the request to crash. No remote code execution or privilege escalation is possible through this vector.

Generated by OpenCVE AI on July 29, 2026 at 13:48 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Mistune to version 3.3.0 or newer to apply the recursion‑cycle fix
  • If an immediate upgrade is not feasible, disable the :include: directive or restrict it to an approved, validated set of files to eliminate recursive inclusion between user‑supplied Markdown documents
  • Apply input validation to reject or sanitize Markdown files that contain more than one :include: directive before they are processed by Mistune

Generated by OpenCVE AI on July 29, 2026 at 13:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8mpj-m6qm-5qr8 Mistune directives/include: mutual `.. include::` recursion crashes the renderer with `RecursionError`, denial of service via two attacker-controlled markdown files
History

Thu, 09 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-835
References
Metrics threat_severity

None

threat_severity

Important


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

Type Values Removed Values Added
Metrics ssvc

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


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

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

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

Type Values Removed Values Added
Description Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the Include directive in src/mistune/directives/include.py detects only direct self-includes and not indirect cycles, allowing two markdown files that include each other to trigger unbounded recursion, raise RecursionError, and crash the rendering request. This issue is fixed in version 3.3.0.
Title Mistune directives/include: mutual `.. include::` recursion crashes the renderer with `RecursionError`, denial of service via two attacker-controlled markdown files
Weaknesses CWE-674
CWE-755
References
Metrics cvssV3_1

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


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-08T19:45:20.799Z

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

Link: CVE-2026-59927

cve-icon Vulnrichment

Updated: 2026-07-08T19:45:11.248Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-08T16:24:37Z

Links: CVE-2026-59927 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-29T14:00:03Z

Weaknesses
  • CWE-674

    Uncontrolled Recursion

  • CWE-755

    Improper Handling of Exceptional Conditions

  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')