From a82202eb1c3ea38e42006cc1b0295fddab4b511c Mon Sep 17 00:00:00 2001 From: Aljes Date: Fri, 4 Dec 2026 12:24:59 +0000 Subject: [PATCH 1/3] Require numcodecs 0.16.6 or later (B0b, #134) numcodecs published GHSA-jqc8-qjfv-5m6r on 2026-10-20: its pickle codec ran code on decode, and 0.15.2, 0.16.6 and 0.17.1 refuse to unpickle unless the process opts in. The floor was 0.14 and the lock pinned 0.16.5, so the image and any resolution could carry a numcodecs that runs a crafted store's code in other readers. The advisory never reached GitHub's advisory database, so Dependabot did not flag the pin (F250). - pyproject.toml: numcodecs>=0.16.6,!=0.17.0 (0.17.0 predates the fix). - uv.lock: numcodecs 0.17.1; nothing else moves. - tests: the guard holds with numcodecs told to unpickle, which makes the marker an oracle again on a patched numcodecs. Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 7 +++++-- tests/test_zarr_safety.py | 34 ++++++++++++++++++++++++++++++++ uv.lock | 41 ++++++++++++++++++++++----------------- 3 files changed, 62 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 261c250..1832f41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,8 +47,11 @@ dependencies = [ # `.shape`, so streaming used memory in proportion to its blocks. 3.16 # brings HDF5 2.0, whose 8 MiB chunk cache `open_store` sets back to 1 MiB. "h5py>=3.16.0,<4", - # Zarr v2 compressors (storage/__init__.py). - "numcodecs>=0.14", + # Zarr v2 compressors (storage/__init__.py). 0.16.6 refuses to decode the + # `pickle` codec unless the process opts in (GHSA-jqc8-qjfv-5m6r), and + # 0.17.0 came out before that fix. adata refuses the codec on any + # numcodecs, but nothing it installs should decode it for other readers. + "numcodecs>=0.16.6,!=0.17.0", "numpy>=2.3.5,<3", # 13.0.0 fixes the decoder advisories that reach `import image` and the # Visium and Xenium tissue images. diff --git a/tests/test_zarr_safety.py b/tests/test_zarr_safety.py index a125970..506a387 100644 --- a/tests/test_zarr_safety.py +++ b/tests/test_zarr_safety.py @@ -204,6 +204,40 @@ def test_every_command_refuses_a_store_naming_the_pickle_codec(tmp_path, marker, assert not list(tmp_path.glob("out*")), "a refused store left an output" +@pytest.mark.parametrize( + "command", + [COMMANDS["convert-h5ad"], COMMANDS["subset"], COMMANDS["export-dataframe"]], + ids=["convert-h5ad", "subset", "export-dataframe"], +) +def test_the_guard_holds_where_numcodecs_is_told_to_unpickle(tmp_path, marker, monkeypatch, command): + """F250: numcodecs 0.16.6 and 0.17.1 refuse to unpickle by themselves, + unless the process opts in, as a pipeline reading its own old stores + may. The guard must not lean on that: with the opt-in on, which makes + the marker mean something again, adata still refuses.""" + pickles = pytest.importorskip("numcodecs.pickles") + monkeypatch.setattr(pickles, "ALLOW_UNSAFE_PICKLE_DECODE", True, raising=False) + src = _poison(_anndata_v2(tmp_path / "evil.zarr"), marker) + (tmp_path / "keep.txt").write_text("c1\nc2\n") + result = runner.invoke(app, [a.format(src=src, tmp=tmp_path) for a in command]) + assert result.exit_code == 1, _out(result) + assert re.search(REFUSED, _out(result)), _out(result) + assert not list(tmp_path.glob("out*")) + + +def test_an_array_no_listing_shows_is_refused_where_numcodecs_is_told_to_unpickle( + tmp_path, marker, monkeypatch +): + """F250: the layer under every read holds without numcodecs' own refusal.""" + pickles = pytest.importorskip("numcodecs.pickles") + monkeypatch.setattr(pickles, "ALLOW_UNSAFE_PICKLE_DECODE", True, raising=False) + store = _hide_categories(_anndata_v2(tmp_path / "evil.zarr"), marker, "no-group-metadata") + out = tmp_path / "out.npy" + result = runner.invoke(app, ["export", "array", str(store), "obs/grp/categories", "-o", str(out)]) + assert result.exit_code == 1, _out(result) + assert re.search(REFUSED, _out(result)), _out(result) + assert not out.exists() + + def _hide_categories(store: Path, marker: Path, how: str) -> Path: """Poison obs/grp's categories where no listing of the store shows it: with no consolidated index, and obs/grp either without its group diff --git a/uv.lock b/uv.lock index ae8ad01..8ebb3d0 100644 --- a/uv.lock +++ b/uv.lock @@ -342,29 +342,34 @@ wheels = [ [[package]] name = "numcodecs" -version = "0.16.5" +version = "0.17.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/44/bd/8a391e7c356366224734efd24da929cc4796fff468bfb179fe1af6548535/numcodecs-0.16.5.tar.gz", hash = "sha256:0d0fb60852f84c0bd9543cc4d2ab9eefd37fc8efcc410acd4777e62a1d300318", size = 6276387, upload-time = "2025-11-21T02:49:48.986Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/f7/7fd3a5066fd07a1541b7937f3f9db73552f48b28a819470c5c00a0c3e472/numcodecs-0.17.1.tar.gz", hash = "sha256:5069dc01b0087c6135cbb3b043707aaf927c992fcd325248d15d907c51dd3747", size = 6290108, upload-time = "2026-10-20T19:37:58.903Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/75/cc/55420f3641a67f78392dc0bc5d02cb9eb0a9dcebf2848d1ac77253ca61fa/numcodecs-0.16.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:24e675dc8d1550cd976a99479b87d872cb142632c75cc402fea04c08c4898523", size = 1656287, upload-time = "2025-11-21T02:49:25.755Z" }, - { url = "https://files.pythonhosted.org/packages/f5/6c/86644987505dcb90ba6d627d6989c27bafb0699f9fd00187e06d05ea8594/numcodecs-0.16.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:94ddfa4341d1a3ab99989d13b01b5134abb687d3dab2ead54b450aefe4ad5bd6", size = 1148899, upload-time = "2025-11-21T02:49:26.87Z" }, - { url = "https://files.pythonhosted.org/packages/97/1e/98aaddf272552d9fef1f0296a9939d1487914a239e98678f6b20f8b0a5c8/numcodecs-0.16.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b554ab9ecf69de7ca2b6b5e8bc696bd9747559cb4dd5127bd08d7a28bec59c3a", size = 8534814, upload-time = "2025-11-21T02:49:28.547Z" }, - { url = "https://files.pythonhosted.org/packages/fb/53/78c98ef5c8b2b784453487f3e4d6c017b20747c58b470393e230c78d18e8/numcodecs-0.16.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ad1a379a45bd3491deab8ae6548313946744f868c21d5340116977ea3be5b1d6", size = 9173471, upload-time = "2025-11-21T02:49:30.444Z" }, - { url = "https://files.pythonhosted.org/packages/1c/20/2fdec87fc7f8cec950d2b0bea603c12dc9f05b4966dc5924ba5a36a61bf6/numcodecs-0.16.5-cp312-cp312-win_amd64.whl", hash = "sha256:845a9857886ffe4a3172ba1c537ae5bcc01e65068c31cf1fce1a844bd1da050f", size = 801412, upload-time = "2025-11-21T02:49:32.123Z" }, - { url = "https://files.pythonhosted.org/packages/38/38/071ced5a5fd1c85ba0e14ba721b66b053823e5176298c2f707e50bed11d9/numcodecs-0.16.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:25be3a516ab677dad890760d357cfe081a371d9c0a2e9a204562318ac5969de3", size = 1654359, upload-time = "2025-11-21T02:49:33.673Z" }, - { url = "https://files.pythonhosted.org/packages/d1/c0/5f84ba7525577c1b9909fc2d06ef11314825fc4ad4378f61d0e4c9883b4a/numcodecs-0.16.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0107e839ef75b854e969cb577e140b1aadb9847893937636582d23a2a4c6ce50", size = 1144237, upload-time = "2025-11-21T02:49:35.294Z" }, - { url = "https://files.pythonhosted.org/packages/0b/00/787ea5f237b8ea7bc67140c99155f9c00b5baf11c49afc5f3bfefa298f95/numcodecs-0.16.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:015a7c859ecc2a06e2a548f64008c0ec3aaecabc26456c2c62f4278d8fc20597", size = 8483064, upload-time = "2025-11-21T02:49:36.454Z" }, - { url = "https://files.pythonhosted.org/packages/c4/e6/d359fdd37498e74d26a167f7a51e54542e642ea47181eb4e643a69a066c3/numcodecs-0.16.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84230b4b9dad2392f2a84242bd6e3e659ac137b5a1ce3571d6965fca673e0903", size = 9126063, upload-time = "2025-11-21T02:49:38.018Z" }, - { url = "https://files.pythonhosted.org/packages/27/72/6663cc0382ddbb866136c255c837bcb96cc7ce5e83562efec55e1b995941/numcodecs-0.16.5-cp313-cp313-win_amd64.whl", hash = "sha256:5088145502ad1ebf677ec47d00eb6f0fd600658217db3e0c070c321c85d6cf3d", size = 799275, upload-time = "2025-11-21T02:49:39.558Z" }, - { url = "https://files.pythonhosted.org/packages/3c/9e/38e7ca8184c958b51f45d56a4aeceb1134ecde2d8bd157efadc98502cc42/numcodecs-0.16.5-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:b05647b8b769e6bc8016e9fd4843c823ce5c9f2337c089fb5c9c4da05e5275de", size = 1654721, upload-time = "2025-11-21T02:49:40.602Z" }, - { url = "https://files.pythonhosted.org/packages/a1/37/260fa42e7b2b08e6e00ad632f8dd620961a60a459426c26cea390f8c68d0/numcodecs-0.16.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3832bd1b5af8bb3e413076b7d93318c8e7d7b68935006b9fa36ca057d1725a8f", size = 1146887, upload-time = "2025-11-21T02:49:41.721Z" }, - { url = "https://files.pythonhosted.org/packages/4e/15/e2e1151b5a8b14a15dfd4bb4abccce7fff7580f39bc34092780088835f3a/numcodecs-0.16.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49f7b7d24f103187f53135bed28bb9f0ed6b2e14c604664726487bb6d7c882e1", size = 8476987, upload-time = "2025-11-21T02:49:43.363Z" }, - { url = "https://files.pythonhosted.org/packages/6d/30/16a57fc4d9fb0ba06c600408bd6634f2f1753c54a7a351c99c5e09b51ee2/numcodecs-0.16.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aec9736d81b70f337d89c4070ee3ffeff113f386fd789492fa152d26a15043e4", size = 9102377, upload-time = "2025-11-21T02:49:45.508Z" }, - { url = "https://files.pythonhosted.org/packages/31/a5/a0425af36c20d55a3ea884db4b4efca25a43bea9214ba69ca7932dd997b4/numcodecs-0.16.5-cp314-cp314-win_amd64.whl", hash = "sha256:b16a14303800e9fb88abc39463ab4706c037647ac17e49e297faa5f7d7dbbf1d", size = 819022, upload-time = "2025-11-21T02:49:47.39Z" }, + { url = "https://files.pythonhosted.org/packages/83/42/3e48ae17b5810f4972140344d86d951c6620ff618901e4e84cb007c5e5e6/numcodecs-0.17.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7cc861d98827e92f93d3ff5b796ec6ee6785efadd44d721496b49e2609365457", size = 1172442, upload-time = "2026-10-20T19:37:28.792Z" }, + { url = "https://files.pythonhosted.org/packages/95/e0/338a68d002397fa896581ff3c8af6ca8c6cba259cda4da2496084b1b1785/numcodecs-0.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d639064acc8f38184e763a5bfe6b5376361c3a79583c67a86a57424629a247c8", size = 979779, upload-time = "2026-10-20T19:37:30.651Z" }, + { url = "https://files.pythonhosted.org/packages/73/72/ca2c75596fe84eba628510595d0b32395205ebf450870f07311adb9cd3e9/numcodecs-0.17.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bfa4d91bacec65232d02402efb82ad08e8c49298e5358d03fe205691ffcca397", size = 1385001, upload-time = "2026-10-20T19:37:32.092Z" }, + { url = "https://files.pythonhosted.org/packages/76/c7/e6b131d0240345bc523873b9f16b22aaca8319abdf0acef4247ccffb3cea/numcodecs-0.17.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e3c08f6f4074eb92b3312efbf293afbbae5697d6b9d009435671a3a18e22ba5", size = 1437783, upload-time = "2026-10-20T19:37:33.861Z" }, + { url = "https://files.pythonhosted.org/packages/8c/80/1fa323d38f42002bc3beb18ec3c5d1eecc8c3c703f497a9f0ea6ddf8e512/numcodecs-0.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:f65d08e20e16430dfb2a21e6a1298b09f98a0ca08a2a9e7aec25a81e4b98b7e5", size = 1497112, upload-time = "2026-10-20T19:37:35.912Z" }, + { url = "https://files.pythonhosted.org/packages/80/01/325b1b78c4602f808e4733e9f88ae4b3f15813c98c9a44d46d799e543bb9/numcodecs-0.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6ca56ab612dbdfffa69c24ad510eaf3cdd794b40dd47144f96f7e0c890fd712c", size = 1171680, upload-time = "2026-10-20T19:37:37.23Z" }, + { url = "https://files.pythonhosted.org/packages/fe/3c/b5350ec12911abfcc69f87113e00ee01beecda4d8550fa081e6a840a73be/numcodecs-0.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0eca3c1c135890911971f6f31e66c9dbfdb28af780c8a53aeadb160478553cd8", size = 976932, upload-time = "2026-10-20T19:37:38.588Z" }, + { url = "https://files.pythonhosted.org/packages/61/3e/59c7ba952edf8e822d76b6b7933c93e7eb5edb11e273162a338c4bcf6985/numcodecs-0.17.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fed686b607d9c1afde8cd0b17d808e29d9a7c8d4ff2c12478456198f57b21e91", size = 1380146, upload-time = "2026-10-20T19:37:39.895Z" }, + { url = "https://files.pythonhosted.org/packages/fb/66/d7ed1f3cf2acdd7066c79e5fbb4a71df275860df4e1951d4209c8a4bf446/numcodecs-0.17.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a67976c03dd62e1b6a5e938c61f643673a6a9a37e17800eca99d1a7ea3c89e2", size = 1431354, upload-time = "2026-10-20T19:37:41.298Z" }, + { url = "https://files.pythonhosted.org/packages/26/80/ab38a26d5633da6c9217bfb04cc38025371d1e785fd6484aed56dd9a6f37/numcodecs-0.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:a5cc666eba758ae20798c6bb1ce406d68db60e3fe0d65aa67e00d130aa1d00f0", size = 1493578, upload-time = "2026-10-20T19:37:42.997Z" }, + { url = "https://files.pythonhosted.org/packages/0a/cf/2a7406e1c0a8b28f885b7ff6b4f1059b1b157e1b221399ab021f3a97e720/numcodecs-0.17.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9edc7ab4a890cf24aaedb5e557c1d3fbdb697afd0135974d81b5b304ea75552d", size = 1173008, upload-time = "2026-10-20T19:37:44.286Z" }, + { url = "https://files.pythonhosted.org/packages/f3/36/47934b70b187a23560fa404ff4835356e3b438cd46f28bd0a4e17abce2af/numcodecs-0.17.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0dac6eaded2c6baeb292ec76df327ea7eb222915ba50b83babf48234b09746cf", size = 978823, upload-time = "2026-10-20T19:37:45.595Z" }, + { url = "https://files.pythonhosted.org/packages/fe/4b/f87f8a1b8c967a06792c052b9df0dd6db6714a42e0d8db3efa6404a72d15/numcodecs-0.17.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:71a1d46317956b8402ce06697911c41fe6b1dd5f24ee7a793830784d202b2548", size = 1388057, upload-time = "2026-10-20T19:37:46.961Z" }, + { url = "https://files.pythonhosted.org/packages/c8/de/14562bb9c6d2b078570383859264b07ecf0d205139e13d37c4d56cb926d5/numcodecs-0.17.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6c0bdf72039d55538c774ac2f695146ab6e36392660664904bfcce1731f0a862", size = 1433317, upload-time = "2026-10-20T19:37:48.253Z" }, + { url = "https://files.pythonhosted.org/packages/d6/30/3b706e1784e3631b1d614447b3b06811a644879c9acca5dec00ab27bf2d4/numcodecs-0.17.1-cp314-cp314-win_amd64.whl", hash = "sha256:fed097ba6c199be3c7dd5a79147d2a7ec23680967c99339a722b4d19069f527b", size = 1535610, upload-time = "2026-10-20T19:37:49.996Z" }, + { url = "https://files.pythonhosted.org/packages/1d/35/69e5a27dd41f8bd916dbff5cbccaf2e4c756884f183015c10b83a63bbee5/numcodecs-0.17.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:2e78cec0a8d88a93cced1e8ad1385415ddbe7f01aa5ad7f7da35b68f4f79414b", size = 1197076, upload-time = "2026-10-20T19:37:51.39Z" }, + { url = "https://files.pythonhosted.org/packages/04/10/8c39a542d7572ab2398874df2b4465001e700e9d3c3ff959a42342a704e6/numcodecs-0.17.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e2b6d32c0e29a050a8f4b891c0f84a808a292b0dff0fb5602eeb5bcd6f7bd2ff", size = 1022856, upload-time = "2026-10-20T19:37:52.905Z" }, + { url = "https://files.pythonhosted.org/packages/00/6b/4549e705a32d8f74a55397f29b69904ec9c04590ec4c59881786c640c0fa/numcodecs-0.17.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a853f4fde6721b35bd33d3cf6f621c4b335d07072346d24cc6af956f6f1b4db", size = 1381637, upload-time = "2026-10-20T19:37:54.493Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ab/5c5e298aade3ba59cff7f1e0a2afe81d180762f9467150976f0dfbb6561b/numcodecs-0.17.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b5930b538468779335640a294728da6737ed6e218316bf36a49d939ac6958e28", size = 1425742, upload-time = "2026-10-20T19:37:55.815Z" }, + { url = "https://files.pythonhosted.org/packages/2c/ce/420b5e439e96d7a619c3122ef58e8847701c9d79a2b8f94702704106ff34/numcodecs-0.17.1-cp314-cp314t-win_amd64.whl", hash = "sha256:39d477687e9b3ceccde69358a62bbdbddb0972638ed90e61eff65537821f03a7", size = 1524207, upload-time = "2026-10-20T19:37:57.3Z" }, ] [[package]] @@ -605,7 +610,7 @@ spatial = [ requires-dist = [ { name = "anndata", marker = "extra == 'dev'", specifier = ">=0.13" }, { name = "h5py", specifier = ">=3.16.0,<4" }, - { name = "numcodecs", specifier = ">=0.14" }, + { name = "numcodecs", specifier = ">=0.16.6,!=0.17.0" }, { name = "numpy", specifier = ">=2.3.5,<3" }, { name = "pandas", marker = "extra == 'dev'", specifier = ">=3.0" }, { name = "pandas", marker = "extra == 'pickle'", specifier = ">=2.2.3" }, From a59cca24992dbb4475b2ed85fca9a8c10b560d8d Mon Sep 17 00:00:00 2001 From: Aljes Date: Fri, 4 Dec 2026 12:24:59 +0000 Subject: [PATCH 2/3] Release 0.17.10 numcodecs 0.16.6 or later, which refuses to unpickle unless asked; the image no longer ships 0.16.5 (#134). - pyproject.toml and uv.lock at 0.17.10. - docs/changelog.md: a 0.17.10 section (Fixed). - STATUS.md: 0.17.10 released; the December audit in progress as epic #149, wave 0 done; the follow-ups it filed move there. Co-Authored-By: Claude Opus 5.5 --- STATUS.md | 92 +++++++++++++---------------------------------- docs/changelog.md | 23 ++++++++++++ pyproject.toml | 2 +- uv.lock | 2 +- 4 files changed, 50 insertions(+), 69 deletions(-) diff --git a/STATUS.md b/STATUS.md index 0645930..dd86d3e 100644 --- a/STATUS.md +++ b/STATUS.md @@ -7,6 +7,7 @@ moves; the plan of record for the current item is in the section below. | Version | What | Issues | |---|---|---| +| 0.17.10 | numcodecs 0.16.6 or later, which refuses to unpickle unless asked; the image no longer ships 0.16.5 | #134 | | 0.17.9 | A Zarr store naming a codec adata does not decode is refused when opened: numcodecs' `pickle`, which a v2 store could name for any text array, ran its author's code on the first read | #132 | | 0.17.8 | Sparse matrices read at least 32 MiB at a time (`subset` of a narrow matrix on Lustre in a quarter of the time); no numpy huge pages, which stalled writes on nodes with fragmented memory; Performance on cluster storage page and the `benchmarks/lustre/` probe | #129, #130 | | 0.17.7 | `import dataframe --categorical` keeps numeric-looking labels (leiden's 0, 1, 10) as categoricals of their text; `convert --feature-type` / `--split-feature-types` take a 10x input with no feature types (Cell Ranger 2) as gene expression; every tag gets its GitHub release from the changelog | #124, #127, #114 | @@ -29,13 +30,17 @@ The conversion epic's sub-issues (#21–#30) are all done and ticked in #20. ## In progress -The December 2026 audit of 0.17.8 (85 findings). Its hotfix, B0, is 0.17.9; -the epic with the other batches is filed once 0.17.9 is out, and the -follow-ups it covers move there. +The fixes from the December 2026 audit of 0.17.8: epic #149, 86 findings +(F165-F250) in 16 batches, #133-#148. Wave 0 is done: B0 (#133), Zarr +codecs that ran code, in 0.17.9 with advisory GHSA-q5v7-469m-2xj2; and B0b +(#134), a patched numcodecs, in 0.17.10. Next is wave 1 (B1-B6, #135-#140) +for 0.17.11, once the epic's proposed decisions for it are confirmed. +Repository settings steps 1 to 3 are applied (2026-12-04); the rest are in +S (#148). -The fixes from the October 2026 audit (epic #87, 164 findings in 16 batches) -finished with 0.17.6; the sub-issues (#88–#103) are all done and ticked in -#87. The batch names in the follow-ups below (B1 to B10) are theirs. +The fixes from the October 2026 audit (epic #87, 164 findings in 16 +batches) finished with 0.17.6. The batch names B1 to B10 in the follow-ups +below are October's. ## Follow-ups noticed @@ -66,80 +71,33 @@ finished with 0.17.6; the sub-issues (#88–#103) are all done and ticked in - An import that adds or replaces only the CSV's columns, joined on the index, and leaves the frame's other columns as they are ("attach metadata" without a round trip of the whole frame). -- GitHub releases stopped at 0.11.1: they were cut by hand, and the release - checklist never said so. PyPI, quay and the benchmark page were unaffected. - `publish.yml` now creates the release from the changelog section (#114). - 0.12.0 to 0.17.6 were backfilled by hand from the changelog plus each - tag's benchmark artifact; the next tag is the first end-to-end check. - GitHub renders each newline in a release body as a line break, so the - changelog's wrapped lines show ragged there; unwrapping paragraphs when - the notes are extracted would fix it (review of #114). -- From waves 3 and 4 of the audit fixes: - - The streaming transpose and other users of `csr_build.BucketSorter` - append every input block to every bucket, (nnz/chunk)² appends, and - each bucket holds three growable datasets (1.8 GB at 30,000 buckets). - The transpose knows its row sizes, so fixed regions as in concat's - `_ColumnBuckets` would do; concat's `_csc_runs` and recast's - `_bucket_runs` could then move into `csr_build` (B3b, B6a). +- From waves 3 and 4 of the October audit fixes (those the December audit + filed are in #149): - The transpose's scratch lives inside a Zarr output and is appended to unbuffered, about 135 times its writes; an HDF5 scratch beside the - output, as concat has, would fix it. It is also missing from recast's - free-space estimate (B3b, B6a, B6b). + output, as concat has, would fix it (B3b, B6a, B6b). - recast's sparse reads are a fixed million entries, not `--chunk`; and `concat`, `recast` and `export` read `--chunk` rows where one chunk height is over the read budget, with column tiles only in `subset`, `split` and `convert` (B6a, B6b). - - `copy_dataset` writes HDF5 text uncompressed: a Zarr to h5ad - conversion's obs index is about nine times anndata's (B6b). - `convert` has no `--chunk`: the cisTopic and MuData converters use a fixed byte budget (B8b, B8c). - - A pickle holding pandas 3's Arrow strings is refused; pycisTopic's - pandas 1.5 never writes one (B8c). - - Python warnings reach stderr with their source line; printing them as - `Warning: ...` lines would match the rest of the output (B5). - - CI's `external-readers` job is named "10x h5 against scanpy and - PyTables" and its `compatibility` job "anndata 0.8-0.13", though the - first checks every converter's reader and the second reads 0.7.8 too. - Renaming a job changes its required-check name, so it waits for the - repository settings (B10). `test_concat_versions.py` is an - `integration` test no CI job runs (B10). - `test_write_safety.py::test_export_writes_to_devices_and_pipes_as_they_are` - failed once in a dozen local runs on macOS: its FIFO reader stayed - blocked with no writer left. The reader thread is not a daemon, so it + failed once in a dozen local runs on macOS, and again under load in the + December audit's review: its FIFO reader stayed blocked with no writer + left. The reader thread is not a daemon, so it also kept pytest from exiting; a daemon thread would at least let the run end (B10). -- From wave 2 of the audit fixes: - - CI: a Python 3.14 leg; Dependabot for the pinned actions, uv and base - image (the pinned actions run on Node 20, which GitHub is retiring); the - base image to Debian trixie; a Codecov token (B9). - - Repository settings: the default workflow token can write, and the - `pypi` environment has no protection rules (B9). - - Zarr stores: their codecs are checked since 0.17.9; the rest of the - counterpart to the HDF5 hardening in 0.17.5 is in the December audit. - - Flex's `target_sets` group is not carried, and `--make-unique` names - export with their suffixes (B8a). - - `formats/textio.py` does not unquote a field that starts with `"`, as - pandas does; if it did, MTX export could quote such names rather than - refuse them (B8a). - - A fixed-width text dataset that HDF5 compressed can inflate far beyond - its stored size when read whole, as the loom import reads var columns; - only loom's global attributes are bounded (B8b). - - Under an outer join, an input lacking some genes counts as lacking var - columns, varm and varp entirely; anndata pads them (B3b). - - A numeric `in` list with thousands of values is slow (B4). -- From wave 1 of the audit fixes: - - `core/csr_build.py`'s on-disk sort makes many small appends, slow for - a Zarr scratch at small budgets; buffer bucket writes in - `BucketSorter` (B2a). +- From wave 2 of the October audit fixes: + - Under an outer join, an input lacking some genes counts as lacking varm + and varp entirely; anndata pads them (B3b; the var columns are F205 in + #141). +- From wave 1 of the October audit fixes: - The dense tile path's temporaries run to about 10-17x the budget, a constant factor rather than growth with the input (B2a). - - `import array obs/` doesn't add the column to `column-order`, so - anndata doesn't show it (pre-existing, B2b). - - The free-space estimate runs low for a var-only subset, a dense loom - output and the transpose's scratch: no false refusals, a weaker check - (B1). - - The floors job lets indirect dependencies float, so a new upstream - release can turn it red, and publish.yml reuses tests.yml (B7). + - The free-space estimate runs low for a dense loom output: no false + refusals, a weaker check (B1; the var-only subset and the transpose's + scratch are F189 and F188 in #138). - `cell_id` (with `in_cell`, `in_nucleus`) on 2 µm bins, from Space Ranger 4's `barcode_mappings.parquet` (a 0.17.x after the audit fixes). - Dropped: spatial bundles whose matrix is a MEX folder only. 10x always diff --git a/docs/changelog.md b/docs/changelog.md index 4f26020..c2d1d2c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,6 +8,29 @@ nav_order: 7 Notable changes to `adata-cli`. Versions are `MAJOR.MINOR.PATCH`; tags carry no `v` prefix. +## 0.17.10 + +numcodecs 0.16.6 or later is now required. numcodecs fixed the root of +0.17.9's security issue in its own releases in October: its `pickle` codec +no longer decodes unless the process opts in. `adata` already refused the +codec whatever numcodecs was installed; the new floor means every +environment `adata` installs, and its container image, carries numcodecs' +fix for other readers too. + +### Fixed + +- **numcodecs 0.16.6 or later is required** + ([#134](https://github.com/cellgeni/adata-cli/issues/134)). numcodecs + 0.15.2, 0.16.6 and 0.17.1 refuse to decode the `pickle` codec unless + `NUMCODECS_ALLOW_UNSAFE_PICKLE_DECODE` is set + ([GHSA-jqc8-qjfv-5m6r](https://github.com/zarr-developers/numcodecs/security/advisories/GHSA-jqc8-qjfv-5m6r)). + The floor was 0.14, so a resolution could keep a numcodecs that runs a + crafted store's code in any reader, and the image shipped 0.16.5. The + floor is now 0.16.6, skipping 0.17.0, and the image ships 0.17.1. adata's + own refusal (0.17.9) holds either way: a test now runs it with numcodecs + told to unpickle. numcodecs' advisory has not reached GitHub's advisory + database, so Dependabot never flagged the old pin. + ## 0.17.9 A security fix: upgrade if you open Zarr stores that someone else wrote. A diff --git a/pyproject.toml b/pyproject.toml index 1832f41..1f352a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ # so the distribution is published as `pyadata-cli`. The import package # and the command are both still `adata`. name = "pyadata-cli" -version = "0.17.9" +version = "0.17.10" description = "Streaming CLI for exploring and editing large AnnData .h5ad and .zarr stores" readme = "README.md" requires-python = ">=3.12" diff --git a/uv.lock b/uv.lock index 8ebb3d0..e3ffe13 100644 --- a/uv.lock +++ b/uv.lock @@ -575,7 +575,7 @@ wheels = [ [[package]] name = "pyadata-cli" -version = "0.17.9" +version = "0.17.10" source = { editable = "." } dependencies = [ { name = "h5py" }, From 08fcad799df21fad5fa8013722e4f770aeb9ce10 Mon Sep 17 00:00:00 2001 From: Aljes Date: Fri, 4 Dec 2026 12:29:58 +0000 Subject: [PATCH 3/3] Review fixes: keep the trixie base image among the follow-ups The follow-up it shared a line with moved to #149, but #149 has no batch that moves the base image to Debian trixie. Co-Authored-By: Claude Opus 5.5 --- STATUS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STATUS.md b/STATUS.md index dd86d3e..fc4f6fb 100644 --- a/STATUS.md +++ b/STATUS.md @@ -89,6 +89,8 @@ below are October's. also kept pytest from exiting; a daemon thread would at least let the run end (B10). - From wave 2 of the October audit fixes: + - The container's base image to Debian trixie (B9; the rest of that + item, the 3.14 leg, Dependabot and Codecov, is in #139 and #146). - Under an outer join, an input lacking some genes counts as lacking varm and varp entirely; anndata pads them (B3b; the var columns are F205 in #141).