{"id":"CVE-2026-6658","kind":"vulnerability","aliases":["CVE-2026-6658","GHSA-9754-6rhw-gj3h"],"related":[],"title":"jupyter/nbconvert allows Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports","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.","summary":"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.","severity":"medium","cvss":5.4,"epss":0.00161,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Run `pip show nbconvert` and compare the version with `7.17.0` or lower.\n- Check whether your pipeline converts notebooks from untrusted sources to HTML with nbconvert.","fix":null,"status":"open","published_at":"2026-06-26T10:16:22+00:00","first_seen_at":"2026-11-06T17:50:30+00:00","triaged_at":"2026-11-06T17:51:09+00:00","updated_at":"2026-11-06T18:13:15+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-11-06T17:51:09Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"internet","title":"nbconvert: notebook HTML exports run injected JavaScript via Mermaid output","impact":"medium","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["nbconvert","python","jupyter","jupyterlab"],"confidence":0.6,"fix_status":"unknown","needs_auth":"no","worst_case":"attacker JavaScript runs in the viewer's browser session","analyst_note":"Confirm the first fixed nbconvert version at https://github.com/advisories/GHSA-9754-6rhw-gj3h; the product range lists no fixed version.","how_to_check":"- Run `pip show nbconvert` and compare the version with `7.17.0` or lower.\n- Check whether your pipeline converts notebooks from untrusted sources to HTML with nbconvert.","plain_action":"","needs_analyst":true,"not_affected_if":["no-untrusted-notebooks","html-export-unused"],"who_is_affected":"Any system that uses nbconvert to turn notebooks into HTML, especially if the notebooks come from users or outside sources. The exposure is in the exported HTML viewed by a person, so a pipeline that only executes notebooks and never publishes or views the HTML is less exposed. The sources do not state a fixed version.","user_interaction":"yes","needs_special_setup":"no","severity_if_unknown":"unknown"},"cost_usd":0.000729,"input_tokens":4419,"output_tokens":574,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-2026':16A,25A '-6':20A '-6658':17A,26A '-79':29B '-9754':19A '7.17.0':77C 'allow':2A,78C,131C 'arbitrari':111C,135C 'attack':66B,108C,132C 'attacker-chosen':65B 'block':95C 'break':50B,114C 'cell':38B,100C 'chosen':67B 'context':139C 'craft':47B 'cross':4A,81C 'cross-sit':3A,80C 'cve':15A,24A 'cwe':28B 'data':93C 'direct':102C 'enabl':107C 'escap':44B,106C 'execut':134C 'export':14A,42B,61B,91C,145C 'ghsa':18A 'gj3h':23A 'html':13A,41B,62B,90C,104C,130C,144C 'html/javascript':112C 'impact':121C 'inject':110C 'javascript':68B,136C 'jupyt':30B 'jupyter/nbconvert':1A,75C 'jupyterlab':31B 'mermaid':94C 'nbconvert':27A,32B,35B,125C 'notebook':48B,128C 'open':59B 'output':11A,39B,88C,101C 'packag':33B 'page':71B 'person':57B 'pre':54B 'python':34B 'render':36B,98C,127C 'rhw':22A 'rhw-gj3h':21A 'run':64B 'script':6A,83C 'server':123C 'share/templates/lab/base.html.j2':97C 'site':5A,82C 'tag':55B,118C 'text/vnd.mermaid':10A,37B,87C,99C 'unsanit':9A,86C 'use':124C 'user':141C 'version':76C 'via':8A,85C 'view':142C 'vulner':73C,120C 'without':43B,105C 'xss':7A,84C","nicknames":[],"mitigations":[],"who_affected":"Any system that uses nbconvert to turn notebooks into HTML, especially if the notebooks come from users or outside sources. The exposure is in the exported HTML viewed by a person, so a pipeline that only executes notebooks and never publishes or views the HTML is less exposed. The sources do not state a fixed version.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"none","audience":"developers","plain_action":null,"pkeys":["nbconvert"],"ptokens":["nbconvert"],"labels":["cwe79","jupyter","jupyterlab","medium","nbconvert","package","pypi","python"],"campaign_type":null,"search_a":"'-2026':16A,25A '-6':20A '-6658':17A,26A '-9754':19A 'allow':2A 'cross':4A 'cross-sit':3A 'cve':15A,24A 'export':14A 'ghsa':18A 'gj3h':23A 'html':13A 'jupyter/nbconvert':1A 'nbconvert':27A 'output':11A 'rhw':22A 'rhw-gj3h':21A 'script':6A 'site':5A 'text/vnd.mermaid':10A 'unsanit':9A 'via':8A 'xss':7A","search_b":"'-79':29B 'attack':66B 'attacker-chosen':65B 'break':50B 'cell':38B 'chosen':67B 'craft':47B 'cwe':28B 'escap':44B 'export':42B,61B 'html':41B,62B 'javascript':68B 'jupyt':30B 'jupyterlab':31B 'nbconvert':32B,35B 'notebook':48B 'open':59B 'output':39B 'packag':33B 'page':71B 'person':57B 'pre':54B 'python':34B 'render':36B 'run':64B 'tag':55B 'text/vnd.mermaid':37B 'without':43B","search_c":"'7.17.0':77C 'allow':78C,131C 'arbitrari':111C,135C 'attack':108C,132C 'block':95C 'break':114C 'cell':100C 'context':139C 'cross':81C 'cross-sit':80C 'data':93C 'direct':102C 'enabl':107C 'escap':106C 'execut':134C 'export':91C,145C 'html':90C,104C,130C,144C 'html/javascript':112C 'impact':121C 'inject':110C 'javascript':136C 'jupyter/nbconvert':75C 'mermaid':94C 'nbconvert':125C 'notebook':128C 'output':88C,101C 'render':98C,127C 'script':83C 'server':123C 'share/templates/lab/base.html.j2':97C 'site':82C 'tag':118C 'text/vnd.mermaid':87C,99C 'unsanit':86C 'use':124C 'user':141C 'version':76C 'via':85C 'view':142C 'vulner':73C,120C 'without':105C 'xss':84C","first_public_at":"2026-06-26T10:16:22+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-9754-6rhw-gj3h","url":"https://github.com/advisories/GHSA-9754-6rhw-gj3h","severity":"medium","published_at":"2026-06-26T12:30:29+00:00","modified_at":"2026-11-06T17:50:16+00:00","first_seen_at":"2026-11-06T17:50:30+00:00","fetched_at":"2026-11-06T18:11:03+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-6658","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-6658","severity":null,"published_at":"2026-06-26T10:16:22+00:00","modified_at":"2026-10-25T22:10:00+00:00","first_seen_at":"2026-11-06T18:13:15+00:00","fetched_at":"2026-11-06T18:13:15+00:00","note":null}],"documents":[],"exploit_sources":[{"type":"epss","score":0.00161,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-6658"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}