Advisory

GHSA-g97x-gvcm-x72h

Also known as: CVE-2026-59926, PYSEC-2026-2214

Summary

Mistune: XSS via unescaped class option in Admonition directive

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-07-20 21:34 UTC
Modified
2026-07-20 21:46 UTC

Affected packages and fixes

mistune

PyPI · All systems

Affected

  • introduced 0, fixed 3.3.0 (ecosystem)

Fixed versions

3.3.0

Fix

  • Fixed version 3.3.0
    pip install --upgrade mistune==3.3.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences