Cross-site Scripting (XSS)Weakness · CWE-79

CVE-2026-6658

MEDIUM · 5.4 CVSS v3.0 Published 2026-06-26
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
58/100
Remediation priority · Elevated
Remotely reachable 8 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The vulnerability exists in nbconvert's HTML export template where Mermaid diagram content (text/vnd.mermaid mime type) is rendered directly into HTML without escaping. The data_mermaid block in share/templates/lab/base.html.j2 inserts content into a <pre> tag without sanitization, allowing attackers to break out of the tag and inject arbitrary JavaScript that executes when users view the exported HTML.

MitigationUpgrade nbconvert to version >7.17.0 where proper HTML escaping is applied to text/vnd.mermaid output, or implement output filtering to sanitize Mermaid content before HTML conversion.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify nbconvert installation and version
    Run `pip show nbconvert` or check your package manager for the installed nbconvert version
    Affected if The installed version is 7.17.0 or lower (vulnerable); versions above 7.17.0 are not affected
  2. Verify Mermaid rendering is in use
    Inspect your notebook export workflow: check if notebooks contain text/vnd.mermaid mime type cells and are being converted to HTML using nbconvert
    Affected if Your exported HTML contains Mermaid diagram content from text/vnd.mermaid cells without additional sanitization
  3. Examine the vulnerable template file
    Locate the file share/templates/lab/base.html.j2 in your nbconvert installation (typically in site-packages/nbconvert) and inspect the data_mermaid block
    Affected if The template contains <pre>{{ content }}</pre> or similar without HTML escaping (e.g., missing the |e filter or |escape filter) and is processing text/vnd.mermaid content
  4. Test for unsanitized output in exported HTML
    Export a notebook with Mermaid content to HTML using nbconvert and examine the raw HTML: search for the <pre> tag containing Mermaid content and verify whether special HTML characters are escaped
    Affected if The Mermaid content in the exported HTML <pre> tag is not HTML-escaped (you can see unescaped <, >, or & characters from the Mermaid syntax)

You are affected if nbconvert version 7.17.0 or lower is installed AND you export notebooks containing text/vnd.mermaid content to HTML without additional sanitization.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade nbconvert to version >7.17.0 where proper HTML escaping is applied to text/vnd.mermaid output, or implement output filtering to sanitize Mermaid content before HTML conversion.

Have this fixed Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,040
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,664.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-6658 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-6658 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data