🛡️ CVE-2026-59923 — mistune

🟡 CVSS 6.1 — Medium ⚠️ Exploit Public CWE-79 OSV
6.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Mistune: XSS via percent-encoded javascript URI bypass in safe_url() ### Summary An XSS vulnerability in Mistune allows bypassing of safe_url() protections via percent-encoded javascript URIs. ### Details The vulnerability exists in HTMLRenderer.safe_url() in Mistune. The function is intended to block harmful URL schemes such as "javascript:" by checking the prefix of the provided URL: _url = url.lower() if _url.startswith(self.HARMFUL_PROTOCOLS): return "#harmful-link" However, the input URL is not URL-decoded before this check. Because of this, an attacker can use percent-encoding to bypass the filter. For example: javascript%3Aalert(1) Since "%3A" is not decoded to ":", the check does not detect the "javascript:" scheme. When rendered in a browser, the URL is decoded, resulting in execution of arbitrary JavaScript upon user interaction. This effectively bypasses Mistune's built-in safe_url() protection mechanism. ### PoC 1. Install vulnerable version: pip install mistune==3.2.0 2. Run the following code: import mistune markdown = mistune.create_markdown() html = markdown("[j](javascript%3Aalert(1))") print(html) 3. Output:

j

4. Open the rendered HTML in a browser and click the link. 5. The browser decodes "%3A" into ":" and executes: javascript:alert(1) ### Impact This is a cross-site scripting (XSS) vulnerability. An attacker can craft a malicious Markdown link that executes JavaScript in the victim's browser when clicked. Impact includes: - Session hijacking (e.g., cookie theft) - Execution of arbitrary JavaScript in the victim's context - Potential account takeover depending on the application This affects any application that renders user-controlled Markdown using Mistune without additional URL sanitization.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality low, integrity low, availability none.

Weakness class

CVE-2026-59923 is classified as CWE-79: Cross-site Scripting (XSS). User-supplied data is written into a page without escaping, so attacker script runs in the browser of anyone who views it.

Affected software

CVE-2026-59923 is recorded against 1 package.

  • mistune (fixed in 3.3.0)

Timeline and source

Published on 20 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)
github.com (Web)
github.com (Web)

Details

Severity MEDIUM
CVSS Score 6.1
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CWE CWE-79
Public Exploit ⚠️ Yes
Source OSV
Published 2026-07-20
Updated 2026-08-12
Modified 2026-07-20

Affected Packages

Software From version Fixed in
mistune 3.3.0

Similar Threats

Exploit Protection

Are you running mistune?

CVE-2026-59923 carries CVSS 6.1 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-59923 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.