CVE-2026-6658: jupyter/nbconvert allows Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports
A vulnerability in jupyter/nbconvert versions tag. This vulnerability impacts any server using nbconvert to render notebooks as HTML, allowing attackers to execute arbitrary JavaScript in the context of users viewing the HTML export.
Published Jun 26, 2026 · Updated Nov 6, 2026
Affected packages
nbconvert
- Ecosystem
- PyPI
- Affected
- <= 7.17.0
- Fixed in
- No patched version yet
- Check
pip show nbconvert
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
A vulnerability in jupyter/nbconvert versions <= 7.17.0 allows for Cross-site Scripting (XSS) via unsanitized text/vnd.mermaid output in HTML exports. The data_mermaid block in share/templates/lab/base.html.j2 renders text/vnd.mermaid cell output directly into HTML without escaping, enabling attackers to inject arbitrary HTML/JavaScript by breaking out of the <pre> tag. This vulnerability impacts any server using nbconvert to render notebooks as HTML, allowing attackers to execute arbitrary JavaScript in the context of users viewing the HTML export.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-114140
nbconvert: Arbitrary file write through path traversal in cell output filenames when exporting to md, latex, rst and asciidoc
high8.8Oct 22, 2026CVE-2026-39377
nbconvert has an Arbitrary File Write via Path Traversal in Cell Attachment Filenames
medium6.5Apr 21, 2026CVE-2026-39378
nbconvert has an Arbitrary File Read via Path Traversal in HTMLExporter Image Embedding
medium6.5Apr 21, 2026CVE-2025-53000
nbconvert has an uncontrolled search path that leads to unauthorized code execution on Windows
high8.5Dec 18, 2025
