Skip to main content

mistune CVE-2026-44896

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-08 https://github.com/lepture/mistune GHSA-58cw-g322-p94v
5.3
CVSS 4.0 · Vendor: https://github.com/lepture/mistune
View

Attack ChainAIDerived

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

  1. Access
    Submit markdown with malicious figclass attribute
  2. Delivery
    Parser processes figure directive
  3. Exploit
    render_figure() concatenates unescaped figclass into HTML
  4. Execution
    HTML attribute injection occurs
  5. Persist
    XSS payload executes in victim's browser context
  6. Impact
    Session hijacking, credential theft, or data exfiltration

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the mistune markdown parser to be configured with figure directive support enabled (the default if using mistune's standard directive plugin). An attacker must be able to submit or control markdown content that is subsequently rendered by an application using mistune - this typically means access to any user input field that accepts markdown (comments, notes, posts, profile descriptions, etc.). No authentication or special configuration is required beyond having the figure directive feature present. The vulnerability affects applications even when HTMLRenderer is explicitly configured with escape=True, defeating the intended security mechanism. Exploitation does not require the attacker to interact with the target user (the malicious payload executes when the markdown is rendered server-side or client-side), though impact scope depends on where the XSS executes (admin dashboard vs. public page) and what session/data is accessible.

Impact

This vulnerability presents a moderate-to-high real-world risk despite missing CVSS/EPSS data. The attack vector is network-accessible (markdown documents can be processed from untrusted sources via web applications using mistune), attack complexity is low (attribute injection requires only crafted markdown syntax), and no privileges or user interaction beyond document submission are required. The vulnerability is particularly concerning because it defeats the intended security feature (escape=True), creating false confidence in XSS protection. The fact that other attributes in the same file are correctly escaped suggests the vulnerability is discoverable and reproducible. Without CVSS/EPSS scoring or KEV confirmation, real-world exploitation likelihood cannot be quantified, but the technical simplicity and applicability to any web application using mistune to render user-submitted markdown makes this a legitimate priority for patching. The missing patch availability is a critical concern - no fixed version currently exists in the public record.

Exploit ScenarioDerived

An attacker submits a markdown document to a web application (e.g., a note-taking service, wiki, or comment system) that uses mistune to render user input. The markdown contains a figure directive with a malicious figclass parameter, e.g., {figure} image.png :figclass: x" onload="alert('XSS') . When the application renders this markdown using mistune, even with HTMLRenderer(escape=True), the unescaped attribute value is concatenated directly into the HTML, producing <figure class="x" onload="alert('XSS')">, which executes the injected JavaScript in the context of the application's origin.

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

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

Alert me

AnalysisAIv1 – May 09, 2026

Cross-site scripting (XSS) via unescaped HTML attributes in mistune's figure directive allows attackers to inject arbitrary HTML and JavaScript when processing markdown documents with figure directives, bypassing the HTMLRenderer escape setting. The figclass and figwidth parameters in render_figure() are concatenated directly into HTML without sanitization, while other attributes in the same file are properly escaped. Vulnerability affects mistune versions through 3.2.0; no patched version is currently released.

RemediationAI

No vendor-released patched version is currently available as of the advisory date. Immediate mitigation requires either: (1) upgrade mistune to a version newer than 3.2.0 once released by the maintainer (monitor the GitHub repository and PyPI for updates); (2) if upgrading is not immediately feasible, disable figure directives entirely by removing or not loading the image directive plugin - this eliminates the attack surface but removes intended markdown functionality; (3) implement a Web Application Firewall (WAF) rule to detect and block markdown containing figure directives with suspicious figclass or figwidth values (e.g., containing quotes, angle brackets, or event handler patterns), though this is a defense-in-depth measure and not a substitute for patching. Additionally, ensure all markdown input is sourced only from trusted users and consider restricting figure directive usage to authenticated/authorized users if feasible within application logic. Monitor the GitHub repository (https://github.com/lepture/mistune) and the GHSA advisory (https://github.com/lepture/mistune/security/advisories/GHSA-58cw-g322-p94v) for patch releases.

Affected Packages

pypi mistune fix: 3.2.1

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 is a markdown parser library for Python that supports custom directives, including image/figure directives. The vulnerable code is in src/mistune/directives/image.py, specifically the render_figure() function at lines 152-168. The vulnerability stems from CWE-79 (improper neutralization of input during web page generation). While the HTMLRenderer class provides an escape=True parameter to sanitize user input, the figure directive handler bypasses this protection by directly concatenating user-supplied figclass and figwidth option values into HTML attribute strings without escaping. Other attributes in the same file (src, alt, style) correctly apply escaping, indicating this is an implementation oversight rather than a systemic issue.

Know when the next one hits your stack

  • 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 (https://github.com/lepture/mistune) PRIMARY 5.3 MEDIUM
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
SUSE 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Red Hat 5.4 MEDIUM

Primary rating from Vendor (https://github.com/lepture/mistune).

CVSS VectorVendor: https://github.com/lepture/mistune

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
May 26, 2026 - 21:22 NVD
5.3 (MEDIUM)
CVE Published
May 08, 2026 - 23:43 nvd
MEDIUM

DescriptionCVE.org

In src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping (lines 152-168).

This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer.

Other attributes in the same file (src, alt, style) are properly escaped; figclass/figwidth were missed.

Threat Intelligence Overview

EPSS Score
0.0%
Top 85% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS GHSA MSRC Vendor GitHub VulDB

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 No
EPSS 0.0%
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· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

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

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

pkg:pip/mistune

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise Module for Python 3 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed

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