Skip to main content

Mistune CVE-2026-59930

| EUVDEUVD-2026-42330 MEDIUM
Insufficient Verification of Data Authenticity (CWE-345)
2026-07-08 GitHub_M GHSA-2hm2-hc3v-44h9 PYSEC-2026-2218
4.3
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit Markdown with injected id='toc_N' HTML element
  2. Delivery
    Mistune toc plugin assigns identical toc_N ID to page heading
  3. Exploit
    Browser resolves anchor to injected element (first match wins)
  4. Execution
    Victim clicks TOC navigation link
  5. Impact
    Navigation or handler redirected to attacker-chosen page element

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Data authenticity verification
Exploitation Conditions

Three specific conditions must all be met: (1) The application must use Mistune's toc plugin or TableOfContents directive - applications using Mistune for basic Markdown rendering without this plugin are not affected. (2) The attacker must be able to inject raw HTML content into the Markdown that Mistune processes - if the application pre-sanitizes or escapes HTML within Markdown input, the id attribute required for the collision cannot be introduced. (3) A user must interact with the page by clicking a table-of-contents navigation link or triggering a CSS/JavaScript selector targeting the hijacked ID (UI:R per CVSS vector). The CVSS PR:N metric reflects that content submission in many public-facing applications (comment systems, open wikis, documentation platforms) requires no authenticated session, though application-level authentication for content submission would constrain the attacker pool.

Impact

The CVSS 3.1 base score of 4.3 (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N) appropriately characterizes this as a moderate-severity integrity issue. The network attack vector reflects that crafted Markdown can be submitted remotely; user interaction (UI:R) is required because a victim must load the page and navigate within it for the hijack to have effect. There is no confidentiality or availability impact. No EPSS score was supplied in the input data - exploitation probability cannot be quantified from available signals. The CVE carries no CISA KEV listing and no public exploit code has been identified, indicating no confirmed active exploitation. Real-world risk is further bounded by three compounding preconditions: the toc plugin must be enabled, the attacker must be able to inject raw HTML into the rendered content, and a user must interact with the affected page. Applications that sanitize HTML within Markdown input or that do not expose the toc plugin are not affected. This is a genuine but contextually narrow integrity risk, not a broad network-exploitable critical flaw despite the network attack vector.

Exploit ScenarioDerived

An attacker submitting Markdown content to a web application that renders it with Mistune's toc plugin enabled includes a raw HTML element such as <span id='toc_0'>malicious anchor</span> early in the document body. When a legitimate heading is processed, Mistune assigns it id='toc_0', but the browser resolves TOC link clicks to the earlier injected element instead, redirecting users to an unexpected page location or triggering a JavaScript handler bound to that selector. No public exploit code has been identified, but the attack requires only knowledge of the sequential ID scheme.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 08, 2026

Predictable heading anchor ID generation in Mistune's toc plugin (all versions prior to 3.3.0) enables same-page navigation hijacking when untrusted Markdown content is rendered. The library assigns sequential numeric identifiers (toc_0, toc_1, etc.) to headings without incorporating heading text, so any party able to inject raw HTML containing a matching id attribute can pre-empt the generated anchor and redirect table-of-contents link targets, CSS selectors, or JavaScript DOM event handlers. No public exploit identified at time of analysis, though the deterministic ID scheme makes collision trivial to engineer once content injection is possible.

RemediationAI

Upgrade to Mistune 3.3.0, which fixes the predictable ID generation by incorporating heading content into anchor slug derivation. The patch commit is available at https://github.com/lepture/mistune/commit/c4093c4742ed0d10d9332fb8edb455869b7b581b and the release is at https://github.com/lepture/mistune/releases/tag/v3.3.0. For applications that cannot immediately upgrade, a viable compensating control is to disable the toc plugin or TableOfContents directive entirely if table-of-contents functionality is not required - this removes the vulnerable code path completely. Alternatively, applications that sanitize Markdown-embedded HTML before rendering (stripping or escaping id attributes from user-supplied content) will prevent the collision attack; note that aggressive sanitization may break legitimate use of HTML attributes within Markdown. There are no known side effects to upgrading to 3.3.0.

Affected VersionsENISA

mistune < 3.3.0

Affected Packages

pypi mistune fix: 3.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Mistune (CPE: cpe:2.3:a:lepture:mistune:*:*:*:*:*:*:*:*) is a pure-Python Markdown parser that supports optional plugins including a toc (table of contents) plugin and a TableOfContents directive. Normally, robust Markdown-to-HTML implementations derive heading anchor IDs by slugifying the heading text (e.g., 'My Section' becomes id='my-section'), producing unique and content-coupled identifiers. Mistune's toc plugin instead generates sequential generic identifiers (toc_0, toc_1, …) independent of heading content. CWE-345 (Insufficient Verification of Data Authenticity) captures this root cause: the library fails to bind the generated identifier to the content it represents, which allows externally supplied HTML to forge a collision. Because browsers resolve same-page anchor fragments to the first matching id in document order, an injected element appearing before the legitimate heading can intercept navigation.

Know when Mistune gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 4.3 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
vuln.today AI 4.3 MEDIUM

Network vector for remote content submission, no privileges if anonymous posting allowed, user interaction required to trigger anchor navigation, integrity-only impact limited to same-page navigation.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 4.3 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

Lifecycle Timeline

1
Patch available
Jul 08, 2026 - 18:02 EUVD

DescriptionCVE.org

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the toc plugin and TableOfContents directive generate heading IDs as predictable toc_N values without slugifying the heading text, allowing attacker-controlled id="toc_N" content to collide with generated anchors and redirect same-page navigation, CSS selectors, or JavaScript handlers. This issue is fixed in version 3.3.0.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 pypi packages depend on mistune (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 3.3.0.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Medium
widely used Python Markdown library across web frameworks and documentation tools
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA MSRC Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +22
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-49851 HIGH POC
8.7 Jun 24

Uncontrolled CPU consumption in Mistune, a Python Markdown parser, allows remote unauthenticated attackers to cause deni

CVE-2026-59928 HIGH POC
7.5 Jul 08

Denial of service in Mistune (the lepture Python Markdown parser) before 3.3.0 lets remote unauthenticated attackers exh

CVE-2026-59922 HIGH POC
7.5 Jul 08

Denial of service in Mistune, a Python Markdown parser, affects all versions prior to 3.3.0 when the strikethrough, mark

CVE-2026-59925 HIGH POC
7.5 Jul 08

Denial of service in Mistune, a widely used pure-Python Markdown parser, affects all versions prior to 3.3.0 where the d

CVE-2026-59923 MEDIUM POC
6.1 Jul 08

Cross-site scripting in Mistune Python Markdown parser (all versions before 3.3.0) allows attacker-controlled Markdown c

CVE-2026-59929 MEDIUM POC
6.1 Jul 08

Cross-site scripting in Mistune prior to 3.3.0 stems from an incomplete URI scheme blocklist in the `safe_url` filter, p

CVE-2017-15612 MEDIUM POC
6.1 Oct 19

mistune.py in Mistune 0.7.4 allows XSS via an unexpected newline (such as in java\nscript:) or a crafted email address,

CVE-2026-59924 MEDIUM POC
5.9 Jul 08

Path traversal in Mistune's Include plugin allows reading arbitrary files from the server filesystem when processing att

CVE-2026-59927 MEDIUM POC
5.3 Jul 08

Unbounded recursion in Mistune's Include directive (all versions prior to 3.3.0) can be triggered by a pair of mutually-

CVE-2026-115347 HIGH
8.7 Oct 22

Quadratic denial of service in Mistune's Markdown parser (parse_link_text) affects versions 3.2.0, 3.2.1 and main prior

CVE-2026-121437 HIGH
8.7 Nov 03

Denial of service in Mistune 3.3.0 through 3.3.3 allows unauthenticated remote attackers to exhaust CPU and stall reques

CVE-2022-34749 HIGH
7.5 Jul 25

In mistune through 2.0.2, support of inline markup is implemented by using regular expressions that can involve a high a

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.0 SUSE Linux Enterprise Server for SAP applications 16.0 Fixed
openSUSE Leap 16.0 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy