GHSA-g97x-gvcm-x72h

Suggest an improvement
Source
https://github.com/advisories/GHSA-g97x-gvcm-x72h
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-g97x-gvcm-x72h/GHSA-g97x-gvcm-x72h.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-g97x-gvcm-x72h
Aliases
Published
2026-07-20T21:34:14Z
Modified
2026-07-20T21:46:40Z
Severity
  • 5.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N CVSS Calculator
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.

Database specific
{
    "cwe_ids":  [
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-07-20T21:34:14Z",
    "nvd_published_at":  "2026-07-08T17:17:28Z",
    "severity":  "MODERATE"
}
References

Affected packages

PyPI / mistune

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.3.0

Affected versions

0.*
0.1.0
0.2.0
0.3.0
0.3.1
0.4
0.4.1
0.5
0.5.1
0.6
0.7
0.7.1
0.7.2
0.7.3
0.7.4
0.8
0.8.1
0.8.2
0.8.3
0.8.4
2.*
2.0.0a1
2.0.0a2
2.0.0a3
2.0.0a4
2.0.0a5
2.0.0a6
2.0.0rc1
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.1.0
3.*
3.0.0a1
3.0.0a2
3.0.0a3
3.0.0rc1
3.0.0rc2
3.0.0rc3
3.0.0rc4
3.0.0rc5
3.0.0
3.0.1
3.0.2
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.2.0
3.2.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-g97x-gvcm-x72h/GHSA-g97x-gvcm-x72h.json"