CVE-2026-6658

Cross-site Scripting (XSS) in jupyter/nbconvert

Published Jun 26, 2026 CVSS 3.1 · 5.4 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability exists in jupyter/nbconvert versions up to 7.17.0. When an exported HTML notebook contains a cell that produces output of media type the rendering template inserts that output directly into the page without escaping. This permits an attacker to place malicious HTML or JavaScript inside the cell, which is then executed in the browser of any user who opens the exported file. This is a Cross‑site scripting flaw, closely aligned with CWE‑79, a type of injection vulnerability that allows arbitrary script execution in the viewer's context and can lead to data theft, session hijacking, or other web‑based attacks.

Affected Systems

Affecting the Jupyter project’s nbconvert component, or earlier are vulnerable. The issue arises whenever a server uses nbconvert to convert notebooks to HTML, including JupyterHub instances, self‑hosted Jupyter servers, or any automatic export pipeline that processes notebooks.

Risk and Exploitability

The CVSS score of 5.4 indicates a moderate impact. No EPSS score is available, and the vulnerability is not listed in CISA KEV, suggesting no known large‑scale exploitation yet. Attackers would need to embed malicious content in a notebook that is later exported to HTML and accessed by a user. If such a notebook can be stored on the server, any visitor who opens the generated HTML will trigger the exploit. The threat is primarily to users viewing exported notebooks, not necessarily the server itself.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade nbconvert to a version newer than 7.17.0.
  • If an immediate upgrade is not possible, configure nbconvert to escape or strip text/vnd.mermaid output before rendering.
  • Restrict notebook uploads to trusted users and review content before export.

Generated by OpenCVE AI on June 26, 2026 at 11:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9754-6rhw-gj3h jupyter/nbconvert allows Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Jupyter
Jupyter jupyter Server
Vendors & Products Jupyter
Jupyter jupyter Server
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Cross-site Scripting (XSS) in jupyter/nbconvert
Weaknesses CWE-79
References
Metrics cvssV3_0

{'score': 5.4, 'vector': 'CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
@huntr_ai
Published
Updated
Jun 26, 2026, 10:19 AM
Reserved
Apr 20, 2026, 8:17 AM
Status
Deferred
Published
Jun 26, 2026, 10:16 AM
Modified
Oct 25, 2026, 10:10 PM
Severity
Moderate
Public date
Jun 26, 2026, 9:40 AM