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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.4
- **CVSS:** 8.4 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: High; User interaction: Active; Confidentiality impact: High; Integrity impact: High; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.66% (percentile 47, 2026-11-26)
- **CWE:** CWE-79
- **Aliases:** BIT-jupyter-base-notebook-2026-40171, BIT-jupyter-notebook-2026-40171, BIT-jupyterlab-2026-40171, GHSA-rch3-82jr-f9w9, PYSEC-2026-2538, PYSEC-2026-2682
- **Published:** 2026-04-30T17:25:47.000Z
- **Modified:** 2026-10-26T19:10:00.163Z

## Who should check

- Projects that depend on npm package @jupyter-notebook/help-extension (\>= 7.0.0, \< 7.5.6)
- Projects that depend on PyPI package notebook (\>= 7.0.0, \< 7.5.6)
- Projects that depend on PyPI package jupyterlab (\< 4.5.7)
- Projects that depend on npm package @jupyterlab/help-extension (\< 4.5.7)
- Anyone running jupyter notebook \>=7.0.0, \<= 7.5.5
- Anyone running jupyterlab help-extension \<=4.5.6
- Anyone running jupyterlab \<= 4.5.6
- Anyone running jupyter-notebook help-extension \>=7.0.0,\<= 7.5.5

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

## Affected and fixed versions

- npm `@jupyter-notebook/help-extension`: affected \>= 7.0.0, \< 7.5.6; fixed 7.5.6 (osv)
- PyPI `notebook`: affected \>= 7.0.0, \< 7.5.6; fixed 7.5.6 (osv)
- PyPI `jupyterlab`: affected \< 4.5.7; fixed 4.5.7 (osv)
- npm `@jupyterlab/help-extension`: affected \< 4.5.7; fixed 4.5.7 (osv)
- jupyter notebook: \>=7.0.0, \<= 7.5.5 (cvelist)
- jupyterlab help-extension: \<=4.5.6 (cvelist)
- jupyterlab: \<= 4.5.6 (cvelist)
- jupyter-notebook help-extension: \>=7.0.0,\<= 7.5.5 (cvelist)

## Mitigation

- Upgrade @jupyter-notebook/help-extension to 7.5.6 or later.
- Upgrade notebook to 7.5.6 or later.
- Upgrade jupyterlab to 4.5.7 or later.
- Upgrade @jupyterlab/help-extension to 4.5.7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-40171. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-40171.md
Affected: @jupyter-notebook/help-extension >= 7.0.0, < 7.5.6; notebook >= 7.0.0, < 7.5.6; jupyterlab < 4.5.7; @jupyterlab/help-extension < 4.5.7
Fixed in: 7.5.6, 4.5.7

Steps:
1. Search this machine and project for @jupyter-notebook/help-extension (npm), notebook (PyPI), jupyterlab (PyPI), @jupyterlab/help-extension (npm), jupyter notebook, jupyterlab help-extension: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-40171 being exploited?

There is no confirmed exploitation: CVE-2026-40171 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.66% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-40171?

High: CVSS 8.4 (v4.0, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2026-40171?

@jupyter-notebook/help-extension \>= 7.0.0, \< 7.5.6; notebook \>= 7.0.0, \< 7.5.6; jupyterlab \< 4.5.7; @jupyterlab/help-extension \< 4.5.7.

### Is there a fix for CVE-2026-40171?

Yes. Fixed in 7.5.6, 4.5.7. Upgrade @jupyter-notebook/help-extension to 7.5.6 or later. Upgrade notebook to 7.5.6 or later. Upgrade jupyterlab to 4.5.7 or later. Upgrade @jupyterlab/help-extension to 4.5.7 or later.

### How do I check if I'm affected by CVE-2026-40171?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/jupyter/notebook/security/advisories/GHSA-rch3-82jr-f9w9>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-40171>
- vendor: <https://github.com/advisories/GHSA-rch3-82jr-f9w9>
- other: <https://github.com/jupyter/notebook>
- other: <https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-in-markdown-output-and-files>
- other: <https://pypi.org/project/jupyterlab>
- other: <https://pypi.org/project/notebook>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-40171>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-rch3-82jr-f9w9> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-2538> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-2682> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-40171> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-40171>
