[26.05] python3Packages.jupyterlab-git: fix CVE-2026-54527 and CVE-2026-54528 (#547982)

This commit is contained in:
Peder Bergebakken Sundt
2026-08-01 17:45:18 +00:00
committed by GitHub
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
diff --git a/jupyterlab_git/handlers.py b/jupyterlab_git/handlers.py
index d463bf9..1470435 100644
--- a/jupyterlab_git/handlers.py
+++ b/jupyterlab_git/handlers.py
@@ -63,7 +63,7 @@ class GitHandler(APIHandler):
if path is not None:
excluded_paths = self.git.excluded_paths
for excluded_path in excluded_paths:
- if fnmatch.fnmatchcase(path, excluded_path):
+ if fnmatch.fnmatchcase(path.casefold(), excluded_path.casefold()):
raise tornado.web.HTTPError(404)
@functools.lru_cache()
diff --git a/jupyterlab_git/tests/test_handlers.py b/jupyterlab_git/tests/test_handlers.py
index 0c8c9ca..a4fd435 100644
--- a/jupyterlab_git/tests/test_handlers.py
+++ b/jupyterlab_git/tests/test_handlers.py
@@ -143,21 +143,18 @@ async def test_git_show_prefix_nested_directory(mock_execute, jp_fetch, jp_root_
)
-async def test_git_show_prefix_for_excluded_path(
- jp_fetch, jp_server_config, jp_root_dir
-):
- local_path = jp_root_dir / "ignored-path"
-
- try:
- response = await jp_fetch(
+@pytest.mark.parametrize("path", ["ignored-path/subdir", "Ignored-Path/subdir"])
+async def test_git_show_prefix_for_excluded_path(path, jp_fetch, jp_server_config):
+ with pytest.raises(HTTPClientError) as error:
+ await jp_fetch(
NAMESPACE,
- local_path.name + "/subdir",
+ path,
"show_prefix",
body="{}",
method="POST",
)
- except HTTPClientError as e:
- assert e.code == 404
+
+ assert_http_error(error, 404)
@patch("jupyterlab_git.git.execute")

View File

@@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
git,
gitMinimal,
nodejs,
@@ -35,6 +36,18 @@ buildPythonPackage rec {
hash = "sha256-BMzn+134hSYUFrDF+4+Bs81hzSURP9VNX4D9x2UuPMQ=";
};
# Remove both patches when updating to 0.54.0 or later.
patches = [
(fetchpatch2 {
name = "CVE-2026-54527.patch";
url = "https://github.com/jupyterlab/jupyterlab-git/commit/c6d37b88f36aa59aee317930b95e427fb9d6b09b.patch?full_index=1";
hash = "sha256-eWE8TVetOyMWAlgjuNL03yxGoPMke+rGiU2H3qSBzM0=";
})
# Adapted from upstream commit 460035275b5963dc96e364e60ba6a73717fbd033
# to the pre-workspace 0.52.0 source layout.
./CVE-2026-54528.patch
];
nativeBuildInputs = [
nodejs
yarn-berry_3.yarnBerryConfigHook
@@ -81,6 +94,14 @@ buildPythonPackage rec {
"test_Git_get_nbdiff_dict"
];
preCheck = ''
jlpm test --runInBand \
src/__tests__/test-components/NotebookDiff.spec.tsx \
src/__tests__/test-components/PlainTextDiff.spec.tsx
pytest jupyterlab_git/tests/test_handlers.py \
-k test_git_show_prefix_for_excluded_path
'';
pythonImportsCheck = [ "jupyterlab_git" ];
__darwinAllowLocalNetworking = true;