You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
B0: Hotfix: Zarr codecs that run code (released in 0.17.9) #133
Goal. Opening a Zarr store never runs code, and no output carries a codec that could. Released in 0.17.9 by #132; advisory GHSA-q5v7-469m-2xj2. The root cause is numcodecs' pickle codec, which numcodecs fixed in 0.15.2, 0.16.6 and 0.17.1 (GHSA-jqc8-qjfv-5m6r); B0b raises our floor to it.
Owns:storage/__init__.py (open_store, copy_path, the codec lists), commands/import_data.py, tests/test_zarr_safety.py, docs/reference/spec-zarr.md
Approach:
restrict_zarr_codecs, run when adata.storage is imported: numcodecs and zarr cannot build a codec outside ZARR_V2_CODECS or ZARR_V3_CODECS, whatever metadata names it and whenever it is read. This is the layer that holds.
open_store refuses such a store before any chunk is read, naming the array; copy_path reads every metadata file a copy would carry, as zarr reads them, before and after the copy.
The lists keep every codec that only compresses or transforms bytes, numbers or text; pickle, json2 and msgpack2 are out.
Two independent reviews: the first found reads the opening walk could not see, which is why the registry layer exists; the second found a copy scan that could be fooled. Both are tests.
Findings
Ref
Sev
Finding
Where
F165
C
Zarr v2 'pickle' codec in .zarray runs arbitrary code on read; outputs keep the codec
Activity
Claptar commentedon Dec 4, 2026
Released in 0.17.9 by #132, with advisory GHSA-q5v7-469m-2xj2. numcodecs' own fix for the root cause (GHSA-jqc8-qjfv-5m6r) becomes our floor in B0b (#134).