JupyterLab Extension Manager looked for updates under unregistered PyPI names, so one click could install an attacker's package
Description
JupyterLab's PyPI Extension Manager looked up and installed updates under a name made from the extension's npm name, not its Python package name. For jupyterlab-lsp, whose npm name is @jupyter-lsp/jupyterlab-lsp, it looked up jupyter-lsp-jupyterlab-lsp, a name that nobody had registered on PyPI. Anyone could register such a name with a higher version. The Extension Manager then offered "Update to" that version on the real extension, and one click installed the attacker's package.
Users are affected if all of the following conditions are true:
- they use JupyterLab 4.0.0 to 4.6.6, or Notebook 7.0.0 to 7.6.5, with the default PyPI Extension Manager;
- they answered "Yes" to "Do you agree to activate this feature?" in the Extension Manager;
- an installed extension is listed under a name that is not an installed Python package (
pip show jupyter-lsp-jupyterlab-lspprintsPackage(s) not found); and - they click "Update to" on it.
Deployments with the read-only extension manager, or with an allowlist of Python package names (allowed_extensions_uris) on JupyterLab 4.5.7 or later, are not affected.
Impact
The attacker's package ran code as the user who runs the Jupyter server, during the installation (source distribution) or at the next start of Python (wheel). That code can read and change the user's files and use credentials from the server's environment, such as a JupyterHub API token.
Patches
JupyterLab 4.6.7 and 4.7.0rc0 contain the patch, and no 4.5.x release with it is planned. The Extension Manager now uses the Python package that installed the extension, and offers no update when that package is not installed.
Notebook bundles its own copy of the affected code, so Notebook users need to update notebook to 7.6.6 (or 7.7.0b3 for pre-releases) as well as jupyterlab. Users of other applications that depend on JupyterLab should update the jupyterlab package too.
Workarounds
Deployments wanting to disable programmatic extension installation entirely can switch to the read-only extension manager:
--LabApp.extension_manager=readonlyor the following traitlet:
c.LabApp.extension_manager = 'readonly'You can confirm that the read-only manager is in use from GUI:
<img width="293" height="293" alt="image" src="github.com/
Users then install, update and remove extensions with pip or conda.
With the PyPI Extension Manager, run pip show with the name of an extension before you click "Update to". If it prints Package(s) not found, update the extension's own package instead, such as pip install --upgrade jupyterlab-lsp.
Note: a mirror of PyPI does not protect you.
References
- jupyterlab.readthedocs.io/
en/ latest/ user/ extensions.html#extension-manager-implementations - allow-list jupyterlab.readthedocs.io/
en/ stable/ user/ extensions.html#listing-configuration - github.com/
jupyterlab/ jupyterlab/ pull/ 20523 - github.com/
jupyterlab/ jupyterlab/ pull/ 20661 - the 4.6.x backport of pull request 20523 - github.com/
jupyterlab/ jupyterlab/ commit/ a095e06b142c85b08b4c4fc0bf56c0cd3c1c2ba2 - the fix for extensions without install.json, in 4.6.7 - github.com/
jupyterlab/ jupyterlab/ commit/ c9a8407937ae8e04ba8d3fe346aaa7b03afbc447 - the fix for extensions without install.json, onmainfor 4.7
Acknowledgments
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-IEJK984A.