{"id":"CVE-2026-59926","aliases":["CVE-2026-59926","GHSA-g97x-gvcm-x72h","PYSEC-2026-2214"],"related":[],"kind":"vulnerability","state":"published","title":"Mistune: XSS via unescaped class option in Admonition directive","summary":"Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.","source":"cvelist"},{"lang":"en","text":"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).\n\nThis allows attribute injection and XSS even when `HTMLRenderer(escape=True)` is used.\n\nThe directive name parameter is safe (validated against whitelist), but the class option comes from raw user input.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Mistune es un analizador de Markdown de Python con renderizadores y complementos. Antes de la versión 3.2.1, render_admonition() en src/mistune/directives/admonition.py concatena la opción :class: de la directiva Admonition en el atributo de clase HTML sin escapar, permitiendo la inyección de atributos y cross-site scripting incluso cuando el modo de escape de HTMLRenderer está habilitado. Este problema se ha solucionado en la versión 3.2.1.","source":"nvd"}],"published":"2026-07-08T16:16:15.681Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 3.2.1","status":"affected"}],"vendor":"lepture","product":"mistune","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.3.0"}],"ecosystem":"PyPI","package":"mistune","purl":"pkg:pypi/mistune","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.3.0"}],"vendor":"mistune_project","product":"mistune","cpe":"cpe:2.3:a:mistune_project:mistune:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.3.0"}],"ecosystem":"PyPI","package":"mistune","purl":"pkg:pypi/mistune","source":"pysec"}],"references":[{"url":"https://github.com/lepture/mistune/security/advisories/GHSA-g97x-gvcm-x72h","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/lepture/mistune/commit/a3cb6e5655308797e8be021d6c7b5bab13cbace2","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/lepture/mistune/releases/tag/v3.2.1","tags":["advisory","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59926","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/lepture/mistune","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2026-2214.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-08T17:48:29.407Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59926","url":"https://www.cve.org/CVERecord?id=CVE-2026-59926","licence":"CVE Terms of Use","modified":"2026-07-08T19:40:52.229Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g97x-gvcm-x72h","url":"https://github.com/advisories/GHSA-g97x-gvcm-x72h","licence":"CC-BY-4.0","modified":"2026-07-20T21:46:40.083Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59926","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59926","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2214","url":"https://osv.dev/vulnerability/PYSEC-2026-2214","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:18.821Z"}],"updatedAt":"2026-11-25T22:59:27.405Z","epss":{"score":0.00189,"percentile":0.08886,"date":"2026-12-01T12:00:22.000Z"}}