CVE-2026-40171 — @jupyter-notebook/help-ex…
CVE-2026-40171 is a Cross-site Scripting (XSS) vulnerability in @jupyter-notebook/help-extension. A fix is available for @jupyter-notebook/help-extension — see the affected versions and patch details below.
Jupyter Notebook and JupyterLab token theft via stored XSS in help command linker
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-40171.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@jupyter-notebook/help-extensionnpm@jupyterlab/help-extensionnpmDescription
Impact
A stored Cross-Site Scripting (XSS) vulnerability in Jupyter Notebook allows attackers to steal authentication tokens from users who open malicious notebook files and interact with elements that the attacker can make look indistinguishable from legitimate controls (single click interaction).
The vulnerability enables complete account takeover through the Jupyter REST API, allowing the attacker to:
- Read all files
- Modify/create files
- Access running kernels and execute arbitrary code
- Create terminals for shell access
Patches
Jupyter Notebook 7.5.6 and JupyterLab 4.5.7 include patches for this vulnerability.
Workarounds
The help extension can be disabled via CLI:
jupyter labextension disable @jupyter-notebook/help-extension
jupyter labextension disable @jupyterlab/help-extension
Hardening
The patched versions include a toggle to disable the command linker functionality altogether, for example via overrides.json:
{
"@jupyterlab/apputils-extension:sanitizer": {
"allowCommandLinker": false
}
}
Resources
- https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-in-markdown-output-and-files
Acknowledgments
Reported by Daniel Teixeira - NVIDIA AI Red Team
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @jupyter-notebook/help-extension | ≥ 7.0.0&&< 7.5.6 | 7.5.6npm install @jupyter-notebook/help-extension@7.5.6 |
| 📦npm | @jupyterlab/help-extension | all versions | 4.5.7npm install @jupyterlab/help-extension@4.5.7 |
| 🐍PyPI | notebook | ≥ 7.0.0&&< 7.5.6 | 7.5.6pip install --upgrade 'notebook==7.5.6' |
| 🐍PyPI | jupyterlab | all versions | 4.5.7pip install --upgrade 'jupyterlab==4.5.7' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @jupyter-notebook/help-extension, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @jupyter-notebook/help-extension to 7.5.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-40171 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important flaw in Jupyter Notebook and JupyterLab, enabling a stored cross-site scripting (XSS) attack. An attacker can craft a malicious notebook that, with a single user click, can steal authentication tokens and fully compromise the Jupyter session, leading to arbitrary code execution and information…
To reduce the risk of exploitation, disable the affected help extensions in Jupyter Notebook and JupyterLab, or set the `allowCommandLinker` option to `false` within the sanitizer configuration. Consult the Jupyter documentation for specific instructions on modifying these settings. Disabling these features may affect the availability of certain help functionalities.Source: Red Hat security advisory for CVE-2026-40171 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Migration Toolkit for Applications 8.2 | mta/mta-solution-server-rhel9:1784109883 | RHSA-2026:43038 |
| Red Hat OpenShift AI 2.25 | rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9:1788315638 | RHSA-2026:65126 |
| Red Hat OpenShift AI 3.4 | rhoai/odh-th06-cpu-torch210-py312-rhel9:1787076778 | RHSA-2026:60520 |
Frequently Asked Questions
Is CVE-2026-40171 in your dependencies?
Find it across npm, PyPI, including transitive dependencies.