PyPI: jupyterlab

CVE-2026-42557

Safety vulnerability ID: SFTY-20260506-41258

Safety legacy ID: pyup.io-96413

Affected versions of the jupyterlab package are vulnerable to Improper Neutralisation of Input During Web Page Generation due to the HTML sanitiser allowlisting the data-commandlinker-command and data-commandlinker-args attributes on button elements while the CommandLinker handler executes the named command without verifying the origin of the click target. The CommandLinker registers a global click listener on document.body that dispatches whichever command is named in the data-commandlinker-command attribute of the clicked element, so a notebook or Markdown file containing a pre-saved HTML cell output with a deceptive button rendered in the output area is sufficient to invoke arbitrary JupyterLab commands without any code being submitted to a kernel. An attacker who shares a notebook or Markdown file via email, GitHub, or a Binder link can, on a single victim click, execute arbitrary code in available kernels, delete files, or spawn multiple kernels and terminals to exhaust server resources, and through a multi-click sequence that grants clipboard access on Chromium-based browsers can obtain full terminal access in the user environment.

Created at: Jun 5, 2026Updated at: Jun 5, 2026

Overview

JupyterLab's command linker attributes in HTML enable one-click command execution from untrusted content

Advisory

Affected versions of the jupyterlab package are vulnerable to Improper Neutralisation of Input During Web Page Generation due to the HTML sanitiser allowlisting the data-commandlinker-command and data-commandlinker-args attributes on button elements while the CommandLinker handler executes the named command without verifying the origin of the click target. The CommandLinker registers a global click listener on document.body that dispatches whichever command is named in the data-commandlinker-command attribute of the clicked element, so a notebook or Markdown file containing a pre-saved HTML cell output with a deceptive button rendered in the output area is sufficient to invoke arbitrary JupyterLab commands without any code being submitted to a kernel. An attacker who shares a notebook or Markdown file via email, GitHub, or a Binder link can, on a single victim click, execute arbitrary code in available kernels, delete files, or spawn multiple kernels and terminals to exhaust server resources, and through a multi-click sequence that grants clipboard access on Chromium-based browsers can obtain full terminal access in the user environment.

Affected Package

Affecting jupyterlab package, versions
<=4.5.6

Also affects

---

How to Fix

Upgrade
jupyterlab
to
4.5.7
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more