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

Published Apr 30, 2026
·
Updated

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: 1. Read all files 2. Modify/create files 3. Access running kernels and execute arbitrary code 4. 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:

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

Other sources

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.

MITRE

Affected Software

5 affected componentsFixes available
npm/@jupyterlab/help-extension<=4.5.6
4.5.7
pip/jupyterlab<=4.5.6
4.5.7
pip/notebook>=7.0.0<=7.5.5
7.5.6
npm/@jupyter-notebook/help-extension>=7.0.0<=7.5.5
7.5.6
IBM API Connect V12 OnPrem<=All

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@jupyterlab/help-extension to a version that resolves this vulnerability.

    Fixed in 4.5.7
  2. Upgrade

    Upgrade pip/jupyterlab to a version that resolves this vulnerability.

    Fixed in 4.5.7
  3. Upgrade

    Upgrade pip/notebook to a version that resolves this vulnerability.

    Fixed in 7.5.6
  4. Upgrade

    Upgrade npm/@jupyter-notebook/help-extension to a version that resolves this vulnerability.

    Fixed in 7.5.6
  5. Upgrade

    Upgrade Jupyter Notebook to a version that resolves this vulnerability.

    Fixed in 7.5.6
  6. Upgrade

    Upgrade JupyterLab to a version that resolves this vulnerability.

    Fixed in 4.5.7
  7. Upgrade

    Upgrade @jupyter-notebook/help-extension to a version that resolves this vulnerability.

    Fixed in 7.5.6
  8. Upgrade

    Upgrade @jupyterlab/help-extension to a version that resolves this vulnerability.

    Fixed in 4.5.7
  9. Configuration

    Set allowCommandLinker to false in the sanitizer configuration to disable the help command linker functionality as a workaround.

    @jupyterlab/apputils-extension:sanitizer allowCommandLinker = false
  10. Configuration

    Disable the help extensions via CLI: run `jupyter labextension disable @jupyter-notebook/help-extension` and `jupyter labextension disable @jupyterlab/help-extension` as a workaround (especially for affected versions prior to 7.5.6 / 4.5.7).

    Jupyter Notebook help extensions (CLI) enabled = disabled

Event History

Apr 30, 2026
Advisory Published
via GitHub·05:25 PM
Data Sourced
via GitHub·05:25 PM
DescriptionWeaknessAffected Software
May 6, 2026
CVE Published
via MITRE·07:36 PM
Data Sourced
via MITRE·07:36 PM
DescriptionWeakness
Data Sourced
via Red Hat·08:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeakness
Jul 7, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-40171?

CVE-2026-40171 is a stored Cross-Site Scripting (XSS) vulnerability, which may allow attackers to steal authentication tokens.

2

How do I fix CVE-2026-40171?

To fix CVE-2026-40171, upgrade to the latest versions of the affected packages, specifically to JupyterLab 4.5.7 or Notebook 7.5.6.

3

What are the affected software versions for CVE-2026-40171?

CVE-2026-40171 affects JupyterLab versions up to 4.5.6 and Notebook versions between 7.0.0 and 7.5.5.

4

Who can exploit CVE-2026-40171?

Any attacker can exploit CVE-2026-40171 by crafting malicious Jupyter Notebook files that users may open.

5

What is the impact of CVE-2026-40171?

The impact of CVE-2026-40171 includes the potential theft of user authentication tokens, compromising user sessions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203