Vulnerability · Published May 26, 2026 · Assigned by GitHub_M
CVE-2026-44898Mistune TOC Anchor Injection XSS
Medium 6.1
In plain English
A medium-severity cross-site scripting in mistune from lepture. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_toc_ul() builds a <ul> table-of-contents tree from a list of (level, id, text) tuples. Both the id value (used as href="#<id>") and the text value (used as the visible link label) are inserted into <a> tags via a plain Python format string — with no HTML escaping applied to either value. When heading IDs are derived from user-supplied heading text (the standard use-case for readable slug anchors), an attacker can craft a heading whose text breaks out of the href="#..." attribute context, injecting arbitrary HTML tags including <script> blocks directly into the rendered TOC. This vulnerability is fixed in 3.2.1.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | mistune | no fix listed | DEBIAN-CVE-2026-44898 |
| Debian:13 | mistune | no fix listed | DEBIAN-CVE-2026-44898 |
| Debian:14 | mistune | no fix listed | DEBIAN-CVE-2026-44898 |
| PyPI | mistune | 3.2.1 | GHSA-6269-cqxg-mhhv |
| PyPI | mistune | 3.2.1 | PYSEC-2026-2208 |
| Ubuntu:22.04:LTS | mistune | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:24.04:LTS | mistune | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:25.10 | mistune | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:26.04:LTS | mistune | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:26.10 | mistune | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:22.04:LTS | mistune0 | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:24.04:LTS | mistune0 | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:25.10 | mistune0 | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:26.04:LTS | mistune0 | no fix listed | UBUNTU-CVE-2026-44898 |
| Ubuntu:26.10 | mistune0 | no fix listed | UBUNTU-CVE-2026-44898 |
Affected products (as reported)
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://github.com/lepture/mistune/security/advisories/GHSA-6269-cqxg-mhhv x_refsource_CONFIRM
- https://github.com/lepture/mistune/releases/tag/v3.2.1 x_refsource_MISC