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.
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?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Jupyter | pip | — | No patch |
| Jupyter | pip | <= 4.5.6 | 4.5.7 |
| Jupyter Notebook | pip | >= 7.0.0, <= 7.5.5 | 7.5.6 |
How severe is it?
What should I do?
6 steps-
PATCH IMMEDIATELY
Upgrade to JupyterLab >= 4.5.7 or notebook >= 7.5.6. No end-user workaround exists for unpatched versions.
-
HARDEN (patched versions): Set
allowCommandLinker: falseinoverrides.jsonunder@jupyterlab/apputils-extension:sanitizerto disable the CommandLinker feature entirely. -
DOWNSTREAM APPS
Applications inheriting from
JupyterFrontEndorJupyterLabcan passcommandLinker: new CommandLinker({ commands: new CommandRegistry() })at initialization to neutralize the attack surface. -
ORGANIZATIONAL CONTROLS
Restrict which notebook files users may open from untrusted sources; enforce notebook provenance policies for JupyterHub deployments; treat
.ipynbfiles from external sources with the same caution as executable files. -
DETECTION
Audit JupyterLab logs for unexpected command execution events; monitor for unusual kernel/terminal spawning patterns in shared environments.
-
EXTENSION AUDIT
Inventory JupyterLab frontend extensions and assess the command attack surface each contributes.
What does CISA's SSVC say?
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:
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
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
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.
References
Timeline
Related Vulnerabilities
CVE-2026-52798 8.9 Gogs: Stored XSS via .ipynb Markdown re-render bypass
Same package: notebook CVE-2026-42266 8.8 JupyterLab: Extension allow-list bypass enables privesc
Same package: notebook CVE-2026-5422 8.1 jupyter-server: path traversal exposes sibling dir files
Same package: notebook CVE-2018-8768 7.8 Jupyter Notebook: XSS via malicious .ipynb file
Same package: notebook CVE-2026-54293 7.5 NLTK: path traversal leaks arbitrary local files
Same package: notebook