CVE-2026-59929

Mistune renderers/html.safe_url: HARMFUL_PROTOCOLS list misses legacy and chained schemes that historically chain to `javascript:` execution

Published Jul 8, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
Description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the safe_url filter in src/mistune/renderers/html.py blocks only javascript:, vbscript:, file:, and data: schemes, allowing legacy or chained schemes such as feed:, view-source:, jar:, livescript:, mocha:, ms-its:, mk:, and res: to reach rendered href and src attributes and potentially execute script in affected user agents. This issue is fixed in version 3.3.0.

Analysis

AI-generated

Technical impact

Mistune’s safe_url filter, before version 3.3.0, blocked only javascript:, vbscript:, file:, and data: schemes but omitted legacy or chained schemes such as feed:, view-source:, jar:, livescript:, mocha:, ms‑its:, mk:, and res:. These omitted schemes can lead to a javascript: URL when chained, enabling an attacker to embed Markdown that, when rendered, injects JavaScript into a victim’s browser and triggers a cross‑site scripting event, a weakness classified as CWE‑184 and CWE‑79.

Affected Systems

All releases of the Mistune Python Markdown parser prior to 3.3.0 are affected, including the 3.2.x series and earlier; any application that renders Markdown content with a vulnerable version—collaborative editors or web services handling user‑supplied Markdown—is at risk.

Risk and Exploitability

The CVSS base score of 6.1 indicates moderate severity, and the EPSS score of less than 1% suggests a very low likelihood of exploitation; the vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that exploitation requires an attacker who can influence the Markdown source rendered by the application, which is common for sites accepting user input; by chaining legacy protocols to a javascript: URL, the attacker can cause arbitrary script execution in the victim’s browser.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mistune to version 3.3.0 or later, where the safe_url filter correctly blocks legacy and chained protocols.
  • If upgrading is not immediately possible, post‑process or strip Markdown URLs that use legacy or chained schemes such as URLs to add an additional defense in depth.
  • Add an additional URL validation layer that blocks legacy or chained protocols—feed:, view‑source:, jar:, livescript:, mocha:, ms‑its:, mk:, and res:—before passing content to Mistune, to ensure safety even if the library changes.

Generated by OpenCVE AI on July 31, 2026 at 13:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-qfrw-5rxm-mhh2 Mistune renderers/html.safe_url: HARMFUL_PROTOCOLS list misses legacy and chained schemes that historically chain to `javascript:` execution
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Lepture
Lepture mistune
Vendors & Products Lepture
Lepture mistune
Type Values Removed Values Added
Description Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the safe_url filter in src/mistune/renderers/html.py blocks only javascript:, vbscript:, file:, and data: schemes, allowing legacy or chained schemes such as feed:, view-source:, jar:, livescript:, mocha:, ms-its:, mk:, and res: to reach rendered href and src attributes and potentially execute script in affected user agents. This issue is fixed in version 3.3.0.
Title Mistune renderers/html.safe_url: HARMFUL_PROTOCOLS list misses legacy and chained schemes that historically chain to `javascript:` execution
Weaknesses CWE-184
CWE-79
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs

  • CWE-79

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 9, 2026, 2:41 PM
Reserved
Jul 7, 2026, 6:20 PM
Status
Analyzed
Published
Jul 8, 2026, 5:17 PM
Modified
Oct 25, 2026, 5:10 PM
Severity
Moderate
Public date
Jul 8, 2026, 4:20 PM