Loading...
Skip to main content

CVE-2026-42557 — JupyterLab's command linker attributes in...

HIGH

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

Published May 6, 2026Updated September 10, 2026Source: osv

Summary

JupyterLab's HTML sanitizer allowlists `data-commandlinker-command` and `data-commandlinker-args` on `button` elements, while `CommandLinker` listens for all click events on `document.body` and executes the named command without checking whether the element came from trusted JupyterLab UI. A notebook with a pre-saved HTML cell output containing a deceptive button can trigger arbitrary JupyterLab commands - including arbitrary code execution - on a single user click, without any code being submitted for execution by the user. ### Impact An attacker who shares a notebook or a Markdown file - via email, GitHub, or a Binder link - can invoke an arbitrary command upon a single click by the victim. The button can be rendered inside the output area and be visually indistinguishable from a legitimate widget. No kernel needs to start; the HTML output is stored in the notebook file and displayed immediately on open. #### Single-click impact An attacker convincing the victim to click on a single button or link can: - execute arbitrary code in the available kernels, - delete files leading to information loss; in principle the loss could be unrecoverable, depending on server configuration and attack complexity, - open multiple kernels/terminals at once, or create multiple files at once, putting significant stress on the server and thus deny availability for other users when using standalone multi-tenant jupyter-server deployment, and to a lesser degree impact availability on JupyterHub deployments. The arbitrary code execution will be immediately visible to the user; and can be halted by the timely user intervention. The deletion of files can be silent and go unnoticed for some time. #### Multi-click attacks An attacker who convinces the victim to click on multiple buttons in specific order and to grant access to clipboard (or in scenarios where the user already granted keyboard access) can obtain full access to the terminal and execute arbitrary commands in the environment with access scope that might exceed that of available kernels. Only users of Chromium-based browsers are susceptible to this expanded variant of the attack. The execution of commands in the terminal would be immediately visible to the user. #### Impact of third-party extensions The impact described above assumes a plain JupyterLab/Notebook installation. In environments with frontend extensions that contribute additional commands the attack surface is increased by the functionality covered by these commands. ### Patches JupyterLab 4.5.7 ### Workarounds No workarounds are available for end-users. Downstream applications inheriting from `JupyterFrontEnd` or `JupyterLab` can effectively disable the `CommandLinker` by passing `commandLinker: new CommandLinker({ commands: new CommandRegistry() })` option in the initialization options. ### Hardening The patched versions include a toggle to disable the command linker functionality altogether, for example via `overrides.json`: ```json { "@jupyterlab/apputils-extension:sanitizer": { "allowCommandLinker": false } } ``` ### Resources - https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-in-markdown-files

Advisory Timeline

  • First published May 6, 2026 (159 days ago).
  • Last revised September 10, 2026 — 126 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update jupyterlab to 4.5.7 or later
pip install "jupyterlab>=4.5.7"
pip
Update notebook to 7.5.6 or later
pip install "notebook>=7.5.6"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: pypi (2).

PackageEcosystemAffectedFixed In
jupyterlab
pypi
0.0.1, 0.0.10, 0.0.13, 0.0.2 (+580 more)4.5.7
notebook
pypi
7.0.0, 7.0.1, 7.0.2, 7.0.3 (+65 more)7.5.6

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.6 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-42557?
JupyterLab's command linker attributes in HTML enable one-click command execution from untrusted content This vulnerability has been assigned a severity rating of HIGH (CVSS score: 9.6/10).
How do I check if my project is affected by CVE-2026-42557?
CVE-2026-42557 affects jupyterlab and notebook. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42557 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.6

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-mqcg-5x36-vfcg
BIT-jupyter-base-notebook-2026-42557
BIT-jupyter-notebook-2026-42557
BIT-jupyterlab-2026-42557
PYSEC-2026-2537
PYSEC-2026-2681

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies