CVE-2026-42557: Jupyter JupyterLab arbitrary command execution via HTML sanitizer bypass

CVE-2026-42557 · Severity: critical · CVSS 9.6 · Published 2026-05-13

JupyterLab and Jupyter Notebook are popular web-based platforms used for data science and scientific computing. A vulnerability in how these platforms handle certain HTML elements allows an attacker to create a malicious notebook or Markdown file that executes unauthorized commands when a user clicks a button. This could lead to arbitrary code execution, data loss through file deletion, or service disruption, potentially compromising the user's entire research environment.

Technologies: Project Jupyter JupyterLab, Project Jupyter Notebook, jupyterlab (PyPI), notebook (PyPI). Vendors: Project Jupyter, PyPI.

Quick answers

Is CVE-2026-42557 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-42557 being exploited in the wild.
How severe is CVE-2026-42557?
Critical severity, with a CVSS score of 9.6, published 13 May 2026.
Which products and versions are affected?
Project Jupyter JupyterLab < 4.5.7; Project Jupyter Notebook >= 7.0.0, <= 7.5.5; jupyterlab (PyPI) ECOSYSTEM:introduced=0,fixed=4.5.7; notebook (PyPI) ECOSYSTEM:introduced=7.0.0,fixed=7.5.6.
Is there a fix for CVE-2026-42557?
Yes. jupyterlab (PyPI): upgrade to 4.5.7 or later; notebook (PyPI): upgrade to 7.5.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-42557 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-42557?
Check whether you run Project Jupyter JupyterLab, Project Jupyter Notebook, jupyterlab (PyPI) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • jupyterlab (PyPI): upgrade to 4.5.7 or later
    pip install "jupyterlab>=4.5.7"
  • notebook (PyPI): upgrade to 7.5.6 or later
    pip install "notebook>=7.5.6"

Technical details

The vulnerability exists because JupyterLab's HTML sanitizer allowlists 'data-commandlinker-command' and 'data-commandlinker-args' attributes on button elements. Simultaneously, the 'CommandLinker' component listens for click events globally on the document body and executes the specified command without verifying if the source element originated from a trusted part of the JupyterLab UI. An attacker can craft a notebook with pre-saved HTML output containing a deceptive button that, when clicked by a victim, triggers arbitrary internal commands. This can result in arbitrary code execution within the kernel, silent file deletion, or denial of service. The attack requires user interaction (a single click) but does not require an active kernel to be running at the time the notebook is opened.

Affected products

  • Jupyter jupyterlab <= 4.5.6
  • Jupyter notebook >= 7.0.0, <= 7.5.5

Identifiers

  • CVE-2026-42557
  • GHSA-mqcg-5x36-vfcg
  • PYSEC-2026-2537
  • PYSEC-2026-2681

Timeline

  • 2026-04-30: disclosed: Initial disclosure by krassowski
  • 2026-05-06: advisory: GitHub Advisory published
  • 2026-05-13: other: NVD publication date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.