PyPI: jupyterlab

CVE-2026-40171

Safety vulnerability ID: SFTY-20260430-81856

Affected versions of the `@jupyter-notebook` package are vulnerable to Cross-site Scripting (XSS) due to improper sanitization of user-generated content within notebook files. The notebook interface fails to adequately sanitize HTML and JavaScript content, allowing malicious scripts to be executed in the context of the user's session. An attacker can exploit this by crafting a notebook file with embedded scripts that, once opened by a user, execute and potentially steal authentication tokens or perform actions on behalf of the user, leading to account compromise.

Created at: Jun 5, 2026Updated at: Jun 5, 2026

Overview

Jupyter Notebook Vulnerable to Authentication Token Theft via CommandLinker XSS

Advisory

@jupyter-notebook – Cross-site Scripting (XSS)

Affected Package

Affecting jupyterlab package, versions
<= 4.5.6

Also affects

---

How to Fix

Upgrade
jupyterlab
to
4.5.7
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more