CVE-2026-59929: lepture mistune XSS via incomplete URL scheme filtering in HTML renderer

CVE-2026-59929 · Severity: medium · CVSS 6.1 · Published 2026-07-08

Mistune is a popular Python library used to convert Markdown text into HTML. A security flaw in its URL filtering allows attackers to bypass safety checks by using obscure or legacy web address formats. If a user clicks a malicious link generated by this library, an attacker could execute unauthorized code in the user's browser, potentially leading to account takeover or data theft.

Technologies: mistune (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-59929 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59929 being exploited in the wild.
How severe is CVE-2026-59929?
Medium severity, with a CVSS score of 6.1, published 8 July 2026.
Which products and versions are affected?
mistune (PyPI) < 3.3.0, ECOSYSTEM:introduced=0,fixed=3.3.0.
Is there a fix for CVE-2026-59929?
Yes. mistune (PyPI): upgrade to 3.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59929 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-59929?
Check whether you run mistune (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • mistune (PyPI): upgrade to 3.3.0 or later
    pip install "mistune>=3.3.0"

Technical details

Mistune's `safe_url` function in `renderers/html.py` relies on a hardcoded `HARMFUL_PROTOCOLS` denylist that only includes 'javascript:', 'vbscript:', 'file:', and 'data:'. This approach fails to account for legacy or chained URI schemes that certain browsers (like older Firefox versions, Internet Explorer, or Edge Legacy) and browser extensions resolve to JavaScript execution. Examples of bypasses include 'feed:javascript:', 'livescript:', and 'ms-its:javascript:'. An attacker can provide these schemes in Markdown links or images to achieve XSS. The vulnerability is addressed in version 3.3.0 by moving to a strict allowlist of safe protocols.

Affected products

  • lepture mistune < 3.3.0

Identifiers

  • CVE-2026-59929
  • GHSA-qfrw-5rxm-mhh2
  • PYSEC-2026-2217

Timeline

  • 2026-06-21: disclosed
  • 2026-07-20: advisory
  • 2026-07-20: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.