CVE-2026-102831: JupyterLab: Cross-site scripting (XSS) in JupyterLab via notebook cells pasted from the system clipboard
JupyterLab 4.5.0 enabled copying and pasing cells through the system clipboard. The paste path parses clipboard text as cell JSON and inserts the cells without clearing metadata.trusted, so a payload can declare its own output as trusted. JupyterLab does not sanitize a trusted output and evaluates the <script> elements it contains, so pasting the cell runs attacker’s JavaScript in the JupyterLab origin. The same payload with "trusted": false is sanitized.
[
{
"cell_type": "code",
"execution_count": null,
"source": "",
"metadata": { "trusted": true },
"outputs": [
{
"output_type": "display_data",
"metadata": {},
"data": { "text/html": "<script>/* runs on paste */</script>" }
}
]
}
]
Users are affected if all of the following are true:
- they run JupyterLab 4.5.0 through 4.6.3, or an application that bundles it such as Notebook 7.5+;
- if running 4.5.2 or newer,
useSystemClipboardForCellsis enabled - it is off by default in 4.5.2+, and always enabled on 4.5.0 and 4.5.1 with no opt-out - they run a Paste Cells command (e.g. from context menu, command palette, shortcut) while attacker-controlled text is in the clipboard; and
pasteCodeCellsWithoutOutputis off, the default, so the pasted cell keeps its outputs
References
- github.com/advisories/GHSA-6966-vjj6-99xv
- github.com/jupyterlab/jupyterlab/commit/1a10a7da5ff655849b21581c2633b46483ae0be9
- github.com/jupyterlab/jupyterlab/commit/7f9f29e29e0c83fb17b0f11da57d06b3c6a40d96
- github.com/jupyterlab/jupyterlab/commit/cf6e89a8d315c4134cefa50c220bca296da466a7
- github.com/jupyterlab/jupyterlab/releases/tag/v4.5.11
- github.com/jupyterlab/jupyterlab/releases/tag/v4.6.4
- github.com/jupyterlab/jupyterlab/security/advisories/GHSA-6966-vjj6-99xv
- nvd.nist.gov/vuln/detail/CVE-2026-102831
Code Behaviors & Features
Detect and mitigate CVE-2026-102831 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →