Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit Markdown with injected id='toc_N' HTML element
-
DeliveryMistune toc plugin assigns identical toc_N ID to page heading
-
ExploitBrowser resolves anchor to injected element (first match wins)
-
ExecutionVictim clicks TOC navigation link
-
ImpactNavigation 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.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- 1 pypi packages depend on mistune (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.3.0.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Uncontrolled CPU consumption in Mistune, a Python Markdown parser, allows remote unauthenticated attackers to cause deni
Denial of service in Mistune (the lepture Python Markdown parser) before 3.3.0 lets remote unauthenticated attackers exh
Denial of service in Mistune, a Python Markdown parser, affects all versions prior to 3.3.0 when the strikethrough, mark
Denial of service in Mistune, a widely used pure-Python Markdown parser, affects all versions prior to 3.3.0 where the d
Cross-site scripting in Mistune Python Markdown parser (all versions before 3.3.0) allows attacker-controlled Markdown c
Cross-site scripting in Mistune prior to 3.3.0 stems from an incomplete URI scheme blocklist in the `safe_url` filter, p
mistune.py in Mistune 0.7.4 allows XSS via an unexpected newline (such as in java\nscript:) or a crafted email address,
Path traversal in Mistune's Include plugin allows reading arbitrary files from the server filesystem when processing att
Unbounded recursion in Mistune's Include directive (all versions prior to 3.3.0) can be triggered by a pair of mutually-
Quadratic denial of service in Mistune's Markdown parser (parse_link_text) affects versions 3.2.0, 3.2.1 and main prior
Denial of service in Mistune 3.3.0 through 3.3.3 allows unauthenticated remote attackers to exhaust CPU and stall reques
In mistune through 2.0.2, support of inline markup is implemented by using regular expressions that can involve a high a
Same technique Information Disclosure
View allVendor 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 |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-42330
GHSA-2hm2-hc3v-44h9
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB