CVE-2026-40171 Jupyter Notebook and JupyterLab token theft via stored XSS in help command linker
Stored XSS in Jupyter help linker allows attackers to steal authentication tokens and execute arbitrary code via malicious notebooks.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-40171?
CVE-2026-40171 is a high-severity cross-site scripting vulnerability in jupyter help-extension, published on 6 May 2026. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Official description
In Jupyter Notebook versions 7.0.0 through 7.5.5, JupyterLab versions 4.5.6 and earlier, and the corresponding @jupyter-notebook/help-extension and @jupyterlab/help-extension packages before 7.5.6 and 4.5.7, a stored cross-site scripting issue in the help command linker can be chained with attacker-controlled notebook content to steal authentication tokens with a single click.
An attacker can craft a malicious notebook file containing elements that appear indistinguishable from legitimate controls and trigger execution when a user interacts with them. Successful exploitation allows theft of the user's authentication token and complete takeover of the Jupyter session through the REST API, including reading files, creating or modifying files, accessing kernels to execute arbitrary code, and creating terminals for shell access. This issue has been fixed in Notebook 7.5.6, JupyterLab 4.5.7, @jupyter-notebook/help-extension 7.5.6, and @jupyterlab/help-extension 4.5.7. As a workaround, disable the affected help extensions or set allowCommandLinker to false in the sanitizer configuration.
Weakness: CWE-79
Which versions are affected by CVE-2026-40171?
13 open source packages ship an affected version, including @jupyter-notebook/help-extension, jupyter-base-notebook and jupyter-notebook.
| Package | Affected | Fixed in |
|---|---|---|
@jupyter-notebook/help-extension npm | From 7.0.0 | 7.5.6 |
@jupyter-notebook/help-extension npm | From 7.0.0 | 7.5.6 |
jupyter-base-notebook Bitnami | From 7.0.0 | 7.5.6 |
jupyter-notebook Bitnami | From 7.0.0 | 7.5.6 |
jupyterlab Bitnami | All versions | 4.5.7 |
jupyterlab PyPI | All versions | 4.5.7 |
7 more packages
jupyterlab PyPI | All versions | 4.5.7 |
jupyterlab PyPI | All versions | 4.5.7 |
notebook PyPI | From 7.0.0 | 7.5.6 |
notebook PyPI | From 7.0.0 | 7.5.6 |
notebook PyPI | From 7.0.0 | 7.5.6 |
@jupyterlab/help-extension npm | All versions | 4.5.7 |
@jupyterlab/help-extension npm | All versions | 4.5.7 |
How do I fix CVE-2026-40171?
Upgrade @jupyter-notebook/help-extension to 7.5.6 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-40171 being exploited?
There is no known exploitation of CVE-2026-40171 in the wild and no public exploit code.
Sources
Also known as BIT-jupyter-base-notebook-2026-40171, BIT-jupyter-notebook-2026-40171, BIT-jupyterlab-2026-40171, CLEANSTART-2026-OX78672, CLEANSTART-2026-SO25555, DEBIAN-CVE-2026-40171 and 4 more.