Executive brief
Jupyter nbconvert is a tool used to convert Jupyter Notebook files into other formats like HTML for sharing and publication. A security flaw allows an attacker to embed malicious code within a notebook's diagram data. When another user views the converted HTML version of that notebook, the malicious code can execute in their browser, potentially leading to unauthorized actions or data theft.
Technical details
A stored Cross-site Scripting (XSS) vulnerability exists in jupyter/nbconvert versions up to and including 7.17.0. The root cause is located in the `data_mermaid` block within the `share/templates/lab/base.html.j2` template, which fails to properly escape `text/vnd.mermaid` cell output. An attacker with the ability to provide or modify a notebook can craft a malicious Mermaid diagram that breaks out of the `<pre>` tag to inject arbitrary HTML or JavaScript. This code executes in the security context of any user viewing the exported HTML file. The vulnerability requires the victim to view the rendered output and typically requires the attacker to have low-level privileges to provide the notebook content.
Affected products
- Jupyter nbconvert <= 7.17.0
Timeline
- 2026-06-26: disclosed
- 2026-06-26: advisory