CVE-2026-42557: JupyterLab: one-click RCE via notebook HTML cell output

GHSA-mqcg-5x36-vfcg HIGH
Published May 6, 2026
CISO Take

JupyterLab's HTML sanitizer incorrectly allowlists `data-commandlinker` attributes on button elements, enabling any pre-saved notebook to embed visually indistinguishable buttons that silently trigger arbitrary JupyterLab commands—including kernel code execution and file deletion—on a single click, with no kernel startup required. With 2,927 downstream dependents, no end-user workarounds available, and an OpenSSF Scorecard of only 4.8/10, this is a high-impact vulnerability across ML development teams, shared JupyterHub environments, and any organization that opens notebooks received via email, GitHub, or Binder links. Exploitation is trivial—crafting a malicious `.ipynb` file requires no AI/ML expertise, and the attack surface expands with every installed JupyterLab frontend extension that contributes commands. Patch immediately to JupyterLab 4.5.7 / notebook 7.5.6; downstream applications inheriting from `JupyterFrontEnd` can disable the CommandLinker via an empty `CommandRegistry` at initialization, and administrators may set `allowCommandLinker: false` in `overrides.json` as a hardening measure.

Sources: GitHub Advisory NVD OpenSSF ATLAS

What is the risk?

HIGH. The vulnerability is trivially exploitable—single user click with no technical prerequisite for the victim. The attack vector (shared notebook files) maps directly to normal ML workflows: researchers routinely open notebooks from GitHub, Binder, and email attachments. With no EPSS data yet but a confirmed patch and public advisory, exploitation probability will rise quickly. The absence of end-user workarounds and the 2,927-dependent blast radius amplify severity. Multi-tenant JupyterHub deployments face an additional DoS surface via kernel/terminal spawning. The single-click trigger mechanism and visual deception make this resistant to even security-aware user behavior.

How does the attack unfold?

Delivery
Attacker crafts a malicious .ipynb notebook with pre-rendered HTML cell output containing a deceptive button carrying `data-commandlinker-command` and `data-commandlinker-args` attributes, then distributes it via email, GitHub, or a Binder link.
AML.T0011.000
Rendering
Victim opens the notebook in JupyterLab; the stored HTML output renders immediately without starting a kernel, displaying a button visually identical to a legitimate UI widget.
AML.T0074
Trigger
Victim clicks the deceptive button; the document-level CommandLinker event listener intercepts the click and executes the named JupyterLab command without verifying element trust origin.
AML.T0011
Impact
Arbitrary JupyterLab commands execute — ranging from kernel code execution and silent file deletion to terminal spawning for full shell access — within the victim's environment and file system scope.
AML.T0050

What systems are affected?

Package Ecosystem Vulnerable Range Patched
Jupyter pip No patch
13.2K OpenSSF 5.8 1.9K dependents Pushed 5d ago 79% patched ~9d to patch Full package profile →
Jupyter pip <= 4.5.6 4.5.7
13.2K OpenSSF 5.8 1.9K dependents Pushed 5d ago 79% patched ~9d to patch Full package profile →
Jupyter Notebook pip >= 7.0.0, <= 7.5.5 7.5.6
13.2K OpenSSF 5.8 3.0K dependents Pushed 5d ago 60% patched ~340d to patch Full package profile →

How severe is it?

CVSS 3.1
N/A
EPSS
0.3%
chance of exploitation in 30 days
Higher than 25% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

What should I do?

6 steps
  1. PATCH IMMEDIATELY

    Upgrade to JupyterLab >= 4.5.7 or notebook >= 7.5.6. No end-user workaround exists for unpatched versions.

  2. HARDEN (patched versions): Set allowCommandLinker: false in overrides.json under @jupyterlab/apputils-extension:sanitizer to disable the CommandLinker feature entirely.

  3. DOWNSTREAM APPS

    Applications inheriting from JupyterFrontEnd or JupyterLab can pass commandLinker: new CommandLinker({ commands: new CommandRegistry() }) at initialization to neutralize the attack surface.

  4. ORGANIZATIONAL CONTROLS

    Restrict which notebook files users may open from untrusted sources; enforce notebook provenance policies for JupyterHub deployments; treat .ipynb files from external sources with the same caution as executable files.

  5. DETECTION

    Audit JupyterLab logs for unexpected command execution events; monitor for unusual kernel/terminal spawning patterns in shared environments.

  6. EXTENSION AUDIT

    Inventory JupyterLab frontend extensions and assess the command attack surface each contributes.

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact total

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity Article 9 - Risk management system
ISO 42001
A.6.1.4 - AI system security testing A.9.4 - Security of AI system outputs and interactions
NIST AI RMF
GOVERN 1.1 - Policies and processes for AI risk management MANAGE 2.2 - Risk response and treatment
OWASP LLM Top 10
LLM02 - Insecure Output Handling

Frequently Asked Questions

What is CVE-2026-42557?

JupyterLab's HTML sanitizer incorrectly allowlists `data-commandlinker` attributes on button elements, enabling any pre-saved notebook to embed visually indistinguishable buttons that silently trigger arbitrary JupyterLab commands—including kernel code execution and file deletion—on a single click, with no kernel startup required. With 2,927 downstream dependents, no end-user workarounds available, and an OpenSSF Scorecard of only 4.8/10, this is a high-impact vulnerability across ML development teams, shared JupyterHub environments, and any organization that opens notebooks received via email, GitHub, or Binder links. Exploitation is trivial—crafting a malicious `.ipynb` file requires no AI/ML expertise, and the attack surface expands with every installed JupyterLab frontend extension that contributes commands. Patch immediately to JupyterLab 4.5.7 / notebook 7.5.6; downstream applications inheriting from `JupyterFrontEnd` can disable the CommandLinker via an empty `CommandRegistry` at initialization, and administrators may set `allowCommandLinker: false` in `overrides.json` as a hardening measure.

Is CVE-2026-42557 actively exploited?

No confirmed active exploitation of CVE-2026-42557 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-42557?

1. PATCH IMMEDIATELY: Upgrade to JupyterLab >= 4.5.7 or notebook >= 7.5.6. No end-user workaround exists for unpatched versions. 2. HARDEN (patched versions): Set `allowCommandLinker: false` in `overrides.json` under `@jupyterlab/apputils-extension:sanitizer` to disable the CommandLinker feature entirely. 3. DOWNSTREAM APPS: Applications inheriting from `JupyterFrontEnd` or `JupyterLab` can pass `commandLinker: new CommandLinker({ commands: new CommandRegistry() })` at initialization to neutralize the attack surface. 4. ORGANIZATIONAL CONTROLS: Restrict which notebook files users may open from untrusted sources; enforce notebook provenance policies for JupyterHub deployments; treat `.ipynb` files from external sources with the same caution as executable files. 5. DETECTION: Audit JupyterLab logs for unexpected command execution events; monitor for unusual kernel/terminal spawning patterns in shared environments. 6. EXTENSION AUDIT: Inventory JupyterLab frontend extensions and assess the command attack surface each contributes.

What systems are affected by CVE-2026-42557?

This vulnerability affects the following AI/ML architecture patterns: Jupyter-based ML development environments, Multi-tenant JupyterHub deployments, Shared notebook collaboration platforms, ML training pipelines with notebook-driven workflows, Data science CI/CD pipelines that render notebooks, Cloud notebook services (Binder, hosted JupyterHub).

What is the CVSS score for CVE-2026-42557?

No CVSS score has been assigned yet.

What is the AI security impact?

Affected AI Architectures

Jupyter-based ML development environmentsMulti-tenant JupyterHub deploymentsShared notebook collaboration platformsML training pipelines with notebook-driven workflowsData science CI/CD pipelines that render notebooksCloud notebook services (Binder, hosted JupyterHub)

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0011 User Execution
AML.T0011.000 Unsafe AI Artifacts
AML.T0049 Exploit Public-Facing Application
AML.T0050 Command and Scripting Interpreter
AML.T0072 Reverse Shell
AML.T0074 Masquerading
AML.T0078 Drive-by Compromise

Compliance Controls Affected

EU AI Act: Article 15, Article 9
ISO 42001: A.6.1.4, A.9.4
NIST AI RMF: GOVERN 1.1, MANAGE 2.2
OWASP LLM Top 10: LLM02

What are the technical details?

Original Advisory

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

Exploitation Scenario

An adversary targeting an ML engineer creates a notebook containing a pre-rendered HTML cell output with a button styled to resemble a standard ipywidgets UI element (e.g., 'Run Analysis' or 'Load Dataset'). The button carries `data-commandlinker-command: terminal:create-new` and `data-commandlinker-args` encoding a shell command. The adversary uploads the notebook to a public GitHub repository, mentions it in a relevant ML community thread, or sends it directly via email citing a shared research result. The victim opens the notebook in JupyterLab—no kernel starts, the HTML renders immediately from stored output—and clicks the deceptive button. The CommandLinker fires, spawning a terminal and executing the attacker's command, which exfiltrates API keys from environment variables or ~/.aws credentials, installs a persistence mechanism, or destroys training data. The entire compromise occurs before the victim realizes anything is wrong, and the terminal execution is the only visible indicator.

Weaknesses (CWE)

CWE-79 — Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'): The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
  • [Implementation, Architecture and Design] Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies. For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters. Parts of the same output document may require different encodings, which will vary depending on whether the output is in the: etc. Note that HTML Entity Encoding is only appropriate for the HTML body. Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed. HTML body Element attributes (such as src="XYZ") URIs JavaScript sections Casca

Source: MITRE CWE corpus.

Timeline

Published
May 6, 2026
Last Modified
May 6, 2026
First Seen
May 7, 2026

Related Vulnerabilities