Repository navigation
1.11.4: a foreign image keeps no JupyterLab - #45
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

A foreign image gets JupyterLab through
datalayer, and a sandbox never serves it: it startsjupyter 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 serverstarts,/apiand/api/kernelspecsanswer, anddatalayer_core,jupyter_kernelsandjupyter_server_nbmodelimport.datalayer_uilogs a warning that its extension cannot load; the server carries on.Not removed: the dompurify inside the
@datalayer/uiandjupyter-ai-agentslabextensions and theagent_runtimesbundle. With no Lab they are not served by a sandbox, and their versions want their own check.