JupyterLab: Cross-site scripting (XSS) in JupyterLab via notebook cells pasted from the system clipboard
## Description 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 `" } } ] } ] ``` 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, `useSystemClipboardForCells` is 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 - `pasteCodeCellsWithoutOutput` is off, the default, so the pasted cell keeps its outputs ### Impact The script runs in the JupyterLab page, in the same origin and session as the authenticated user, so it can call the Jupyter Server REST API as that user: read and write any file under the server root, start a kernel and run code in it, and open a terminal where terminals are enabled. It runs on paste, without the user executing anything. Only the output of a code cell can run a script this way. Markdown and raw cells are always sanitized, as the [trust documentation](https://jupyterlab.readthedocs.io/en/latest/user/notebook.html#trust) states. The attacker needs no JupyterLab account and no access to th
PYSEC-2026-4112
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:PYSEC-2026-4112
notebook
Source reference: /affected/0/package/name
- Affected versions
- 7.5.0
Source reference:
/affected/0/versions7.5.1Source reference:
/affected/0/versions7.5.2Source reference:
/affected/0/versions7.5.3Source reference:
/affected/0/versions7.5.4Source reference:
/affected/0/versions7.5.5Source reference:
/affected/0/versions7.5.6Source reference:
/affected/0/versions7.5.7Source reference:
/affected/0/versions7.5.8Source reference:
/affected/0/versions7.6.0Source reference:
/affected/0/versions7.6.0a0Source reference:
/affected/0/versions7.6.0a1Source reference:
/affected/0/versions7.6.0a2Source reference:
/affected/0/versions7.6.0a3Source reference:
/affected/0/versions7.6.0a4Source reference:
/affected/0/versions7.6.0a5Source reference:
/affected/0/versions7.6.0b0Source reference:
/affected/0/versions7.6.0b1Source reference:
/affected/0/versions7.6.0rc0Source reference:
/affected/0/versions7.6.0rc1Source reference:
/affected/0/versions7.6.1Source reference:
/affected/0/versions7.6.2Source reference:
/affected/0/versions - Fixed versions
- 7.6.3
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "7.5.0"
},
{
"fixed": "7.6.3"
}
]
}
],
"package": {
"name": "notebook",
"purl": "pkg:pypi/notebook",
"ecosystem": "PyPI"
},
"versions": [
"7.5.0",
"7.5.1",
"7.5.2",
"7.5.3",
"7.5.4",
"7.5.5",
"7.5.6",
"7.5.7",
"7.5.8",
"7.6.0",
"7.6.0a0",
"7.6.0a1",
"7.6.0a2",
"7.6.0a3",
"7.6.0a4",
"7.6.0a5",
"7.6.0b0",
"7.6.0b1",
"7.6.0rc0",
"7.6.0rc1",
"7.6.1",
"7.6.2"
],
"database_specific": {
"source": "https://github.com/pypa/advisory-database/blob/main/vulns/notebook/PYSEC-2026-4112.yaml"
}
}
]- Related CVEs
- CVE-2026-102831
Source reference:
/aliases
Publisher severity
high
Source reference: /severity/0/score
- Event
- #83663 · Revision 1
- Added to Heist Feed
- Publisher date