Junglewise Threat Intelligence

CVE-2026-59923: lepture Mistune XSS via percent-encoded bypass in safe_url

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

Technologies: Lepture Mistune. Vendors: PyPI.

Executive brief

Mistune is a popular Python library used to convert Markdown text into HTML. A security flaw in its URL filtering mechanism allows attackers to bypass safety checks by using specially encoded links. If a user clicks on one of these malicious links, an attacker could execute arbitrary code in the user's browser, potentially leading to account theft or unauthorized access to sensitive data.

Technical details

A cross-site scripting (XSS) vulnerability exists in Mistune's HTMLRenderer.safe_url() function. The component attempts to block harmful protocols like 'javascript:' by checking the start of the URL string, but it fails to URL-decode the input before performing this check. An attacker can bypass the filter by using percent-encoding (e.g., 'javascript%3A') which is ignored by the startswith() check but later decoded and executed by the victim's browser. This allows for arbitrary JavaScript execution in the context of the application. The vulnerability is addressed in version 3.3.0.

Affected products

  • lepture mistune < 3.3.0

Timeline

  • 2026-06-21: disclosed
  • 2026-07-08: advisory: NVD publication date
  • 2026-07-20: advisory: GitHub Advisory published
  • 2026-07-20: patched: Version 3.3.0 released

References

Related threats