GHSA-6966-vjj6-99xv: XSS

Published Oct 1, 2026
·
Updated

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 <script> elements it contains, so pasting the cell runs attacker's JavaScript in the JupyterLab origin. The same payload with "trusted": false is sanitized.

json [ { "celltype": "code", "executioncount": null, "source": "", "metadata": { "trusted": true }, "outputs": [ { "outputtype": "displaydata", "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, 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 states.

The attacker needs no JupyterLab account and no access to the server, only the user's clipboard at the moment of the paste. A web page can replace the text you copy from it, or write the clipboard directly once you have given it permission. Both need you to click or press a key on that page first.

Patches

JupyterLab v4.6.4 and v4.5.11 contain the patch. Cells read from the system clipboard that cannot be traced to the current window no longer carry metadata.trusted into the notebook, so their outputs are sanitized like any other content of unknown origin.

Users of applications that depend on JupyterLab, such as Notebook v7+, should update jupyterlab package too.

Workarounds

On 4.5.2 and later, confirm that the system clipboard is not in use for cells. The setting is off by default; check Settings, Notebook, or the raw value:

json { "@jupyterlab/notebook-extension:tracker": { "useSystemClipboardForCells": false } }

With that setting off, cell copy and paste use JupyterLab's in-application clipboard, which never leaves the page. The cost is that cells can no longer be copied between browser tabs or windows.

On 4.5.0 and 4.5.1 there is no such setting, and every paste reads the system clipboard and upgrade is highly recommended.

Pasting cells without their outputs also stops the script from running, at the cost of discarding outputs on every paste:

json { "@jupyterlab/notebook-extension:tracker": { "pasteCodeCellsWithoutOutput": true } }

Affected Software

5 affected componentsFixes available
pip/jupyterlite-core>=0.7.0<=0.8.3
0.8.4
pip/jupyterlite>=0.7.0<=0.8.3
0.8.4
pip/notebook>=7.5.0<=7.6.2
7.6.3
pip/jupyterlab>=4.5.0<=4.5.10
4.5.11
pip/jupyterlab>=4.6.0<=4.6.3
4.6.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/jupyterlite-core to a version that resolves this vulnerability.

    Fixed in 0.8.4
  2. Upgrade

    Upgrade pip/jupyterlite to a version that resolves this vulnerability.

    Fixed in 0.8.4
  3. Upgrade

    Upgrade pip/notebook to a version that resolves this vulnerability.

    Fixed in 7.6.3
  4. Upgrade

    Upgrade pip/jupyterlab to a version that resolves this vulnerability.

    Fixed in 4.5.11
  5. Upgrade

    Upgrade pip/jupyterlab to a version that resolves this vulnerability.

    Fixed in 4.6.4
  6. Upgrade

    Upgrade jupyterlab to a version that resolves this vulnerability.

    Fixed in 4.6.4
  7. Upgrade

    Upgrade jupyterlab to a version that resolves this vulnerability.

    Fixed in 4.5.11
  8. Configuration

    On JupyterLab 4.5.2 and later, disable useSystemClipboardForCells so cell copy and paste use the in-application clipboard.

    JupyterLab useSystemClipboardForCells = false
  9. Configuration

    Enable pasteCodeCellsWithoutOutput to prevent pasted code-cell outputs, including scripts in trusted outputs, from being inserted; this discards outputs on every paste.

    JupyterLab pasteCodeCellsWithoutOutput = true

Event History

Oct 1, 2026
Advisory Published
via GitHub·03:20 PM
Data Sourced
via GitHub·03:20 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed by default?

JupyterLab 4.5.0 and 4.5.1 are exposed because system clipboard cell copying and pasting is always enabled with no opt-out. In JupyterLab 4.5.2 through 4.6.3, the affected path requires useSystemClipboardForCells to be enabled; it is off by default.

2

What must an attacker do for exploitation to occur?

The attacker must cause attacker-controlled text containing cell JSON to be present in the victim's system clipboard. The victim must then invoke a Paste Cells command, such as through the context menu, command palette, or shortcut, causing the pasted cell's trusted HTML output to be evaluated.

3

Can this affect applications that bundle JupyterLab?

Yes. The advisory identifies Notebook 7.5+ as an example of an application that bundles JupyterLab and may be affected when it includes the vulnerable JupyterLab behavior.

4

What configuration change can reduce exposure when it is available?

For JupyterLab 4.5.2 and newer, keep useSystemClipboardForCells disabled. This setting is already off by default in those versions; JupyterLab 4.5.0 and 4.5.1 do not provide an opt-out.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203