Skip to content

1.11.4: a foreign image keeps no JupyterLab - #45

Merged
echarles merged 1 commit into
mainfrom
fix/foreign-no-jupyterlab
Nov 1, 2026
Merged

echarles merged 1 commit into
mainfrom
fix/foreign-no-jupyterlab

Conversation

@echarles

@echarles echarles commented Nov 1, 2026

Copy link
Copy Markdown
Member

A foreign image gets JupyterLab through datalayer, and a sandbox never serves it: it starts jupyter server.

JupyterLab 4.6.5, the latest release, pins dompurify 3.4.16 (GHSA-cg2g-xh64-v4q7, critical, fixed in 3.4.17), in its static bundle and its staging lock. The scan blocks the build and no JupyterLab release moves past it. Deleting the lock alone would pass the scan with the bundle still there, so the package goes.

Tested on python:3.12-slim with the contract's packages, on PyPI's jupyter-server rather than the fork: without JupyterLab, jupyter server starts, /api and /api/kernelspecs answer, and datalayer_core, jupyter_kernels and jupyter_server_nbmodel import. datalayer_ui logs a warning that its extension cannot load; the server carries on.

Not removed: the dompurify inside the @datalayer/ui and jupyter-ai-agents labextensions and the agent_runtimes bundle. With no Lab they are not served by a sandbox, and their versions want their own check.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The uv uninstall command lacks --break-system-packages, causing image builds to fail on supported images with distribution-managed Python, such as Ubuntu 24.04.

1 open issue
What changed in this PR

Removes JupyterLab from foreign sandbox images to eliminate its bundled vulnerable dompurify assets while retaining the Jupyter Server runtime.

Changes:

  • Uninstalls JupyterLab after the contract packages are installed.
  • Adds a regression assertion for the generated uninstall command.
  • Bumps the package version to 1.11.4.
File Description
tests/​test_environment_foreign_contract_layer.py Checks that the foreign-image contract uninstalls JupyterLab.
code_sandboxes/​environments/​adapters/​datalayer.py Adds the JupyterLab uninstall build step.
code_sandboxes/​__version__.py Updates the version to 1.11.4.

Review effort: Balanced

# `datalayer` brings JupyterLab, which a sandbox never serves: it starts
# `jupyter server`. Out, and with it Lab's bundle and staging lock,
# whose pins can block the scan with no fixed release to move to.
"RUN uv pip uninstall --system jupyterlab",
@echarles
echarles merged commit dcd98d6 into main Nov 1, 2026
9 checks passed
@echarles
echarles deleted the fix/foreign-no-jupyterlab branch November 1, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants