Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. mistune
  4. ›
  5. CVE-2026-59926

CVE-2026-59926: Mistune: XSS via unescaped class option in Admonition directive

July 20, 2026

In src/mistune/directives/admonition.py, the render_admonition() function concatenates the :class: option directly into the HTML class attribute without escaping (lines 63-68).

This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used.

The directive name parameter is safe (validated against whitelist), but the class option comes from raw user input.

References

  • github.com/advisories/GHSA-g97x-gvcm-x72h
  • github.com/lepture/mistune/commit/a3cb6e5655308797e8be021d6c7b5bab13cbace2
  • github.com/lepture/mistune/releases/tag/v3.2.1
  • github.com/lepture/mistune/security/advisories/GHSA-g97x-gvcm-x72h
  • github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2026-2214.yaml
  • nvd.nist.gov/vuln/detail/CVE-2026-59926

Code Behaviors & Features

Detect and mitigate CVE-2026-59926 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.3.0

Fixed versions

  • 3.3.0

Solution

Upgrade to version 3.3.0 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

pypi/mistune/CVE-2026-59926.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:54 +0000.