---
id: "CVE-2026-6658"
page: "https://infrastack.ai/live/CVE-2026-6658"
kind: "vulnerability"
aliases: ["CVE-2026-6658", "GHSA-9754-6rhw-gj3h"]
title: "jupyter/nbconvert allows Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports"
severity: "medium"
cvss: 5.4
epss: 0.00161
exploited: false
status: "open"
category: "package"
products: [{"name": "nbconvert", "fixed": [], "affected": "<= 7.17.0", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-79", "jupyter", "jupyterlab", "nbconvert", "package", "python"]
not_affected_if: ["html-export-unused", "no-untrusted-notebooks"]
published_at: "2026-06-26T10:16:22+00:00"
first_seen_at: "2026-11-06T17:50:30+00:00"
updated_at: "2026-11-06T18:13:15+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-9754-6rhw-gj3h", "first_seen_at": "2026-11-06T17:50:30+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-6658", "first_seen_at": "2026-11-06T18:13:15+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00161, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-6658"}]
---

# jupyter/nbconvert allows Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports

Link for people: https://infrastack.ai/live/CVE-2026-6658 (this .md is for agents)

nbconvert renders text/vnd.mermaid cell output into HTML exports without escaping, so a crafted notebook can break out of a pre tag. A person who opens the exported HTML then runs attacker-chosen JavaScript in that page.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:nbconvert affected <= 7.17.0 fixed no fixed version listed

## How to check

- Run `pip show nbconvert` and compare the version with `7.17.0` or lower.
- Check whether your pipeline converts notebooks from untrusted sources to HTML with nbconvert.

## Timeline

- 2026-11-06T17:50:30+00:00 ghsa https://github.com/advisories/GHSA-9754-6rhw-gj3h
- 2026-11-06T18:13:15+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-6658

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
