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.
Published: 2026-06-26
Score: 5.4 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Fri, 26 Jun 2026 11:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 26 Jun 2026 10:00:00 +0000

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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: @huntr_ai

Published:

Updated: 2026-06-26T10:19:12.444Z

Reserved: 2026-04-20T08:17:42.331Z

Link: CVE-2026-6658

cve-icon Vulnrichment

Updated: 2026-06-26T10:18:52.978Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-26T12:00:13Z

Weaknesses
  • CWE-79

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