CVE-2026-40171
CVE-2026-40171 is a remote code execution vulnerability in @jupyter-notebook/help-extension. O3 Security confirms whether CVE-2026-40171 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Jupyter Notebook and JupyterLab token theft via stored XSS in help command linker
Blast Radius
@jupyter-notebook/help-extension📦@jupyterlab/help-extension🐍notebook🐍jupyterlabReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm, PyPI packages — download data is not available via public APIs for these ecosystems.
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @jupyter-notebook/help-extension | ≥ 7.0.0&&< 7.5.6 | 7.5.6 |
| 📦npm | @jupyterlab/help-extension | all versions | 4.5.7 |
| 🐍PyPI | notebook | ≥ 7.0.0&&< 7.5.6 | 7.5.6 |
| 🐍PyPI | jupyterlab | all versions | 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. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
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
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether CVE-2026-40171 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to CVE-2026-40171. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-40171 in your dependencies?
O3 detects CVE-2026-40171 across npm, PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.