Skip to main content
Menu
Advisories

JupyterLab Extension Manager looked for updates under unregistered PyPI names, so one click could install an attacker's package

GHSA-7MXP-RXGC-HXP8Published Updated GitHub

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-lsp prints Package(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=readonly

or 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/user-attachments/assets/8016c809-633e-4ed0-a5bc-6bc4793caa0f" />

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

Acknowledgments

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-IEJK984A.

Affected versions

References

GitHub · jupyterlab/jupyterlab