Skip to content

B0: Hotfix: Zarr codecs that run code (released in 0.17.9) #133

Done

Description

@Claptar

Part of #149.

wave 0 · 0.17.9 · size S

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 storage/__init__.py:276

Done: #132, released in 0.17.9.

Activity

  1. added
    bug
    on Dec 4, 2026
  2. Claptar commented on Dec 4, 2026

    @Claptar
    ContributorAuthor

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions