Downloads · 30 days
0
pragnyanramtha/flax-orbax-sparse-shape-poc
flax-orbax-sparse-shape-poc is a machine learning model from pragnyanramtha. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a benign security PoC for a Flax/Orbax checkpoint resource-amplification issue. It demonstrates a tiny legacy Orbax/Zarr checkpoint whose model-controlled metadata restores as a much larger zero-filled float32…
Downloads · 30 days
0
Access
Public
Updated May 12, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py5.3 KB · 42%
From the Hugging Face model README
This is a benign security PoC for a Flax/Orbax checkpoint resource-amplification issue. It demonstrates a tiny legacy Orbax/Zarr checkpoint whose model-controlled metadata restores as a much larger zero-filled float32 tensor.
build_poc.py creates the checkpoint artifact.verify_poc.py restores the checkpoint and writes results.json.poc_sparse_shape_checkpoint/checkpoint_0/ is the generated checkpoint artifact.poc_sparse_shape_checkpoint/artifact_manifest.json records file sizes and SHA256 values.modelscan_checkpoint_0.json is ModelScan output.results.json is runtime restore output from the local validation run.The checkpoint uses legacy Orbax/Zarr layout with:
_METADATA: store_array_data_equal_to_fill_value=falsemarker/.zarray: a large declared shapeOn restore, current Orbax/TensorStore fills missing chunk data and materializes the declared array. The staged artifact uses a safe default shape of 8,000,000 float32 elements, allocating about 32 MB from a sub-kilobyte checkpoint.
python -m venv .venv
.venv/Scripts/python -m pip install flax orbax-checkpoint modelscan transformers msgpack psutil numpy
.venv/Scripts/python build_poc.py --shape 8000000
.venv/Scripts/python verify_poc.py
.venv/Scripts/modelscan scan -p poc_sparse_shape_checkpoint/checkpoint_0 -r json --show-skipped -o modelscan_checkpoint_0.json
Expected restore output includes:
restored_shape: [8000000]restored_dtype: float32restored_nbytes: 32000000first_value and last_value: 0.0ModelScan 0.8.8 reports zero issues and skips _CHECKPOINT_METADATA, _METADATA, and marker/.zarray as unsupported files. This is not an ACE scanner bypass; it is scanner/runtime evidence for a currently unsupported Flax/Orbax checkpoint surface.
An attacker-controlled checkpoint can be much smaller on disk than the array materialized during restore. Increasing the declared Zarr shape scales the allocation and can produce a denial of service in services that restore untrusted Flax/Orbax checkpoints.
Limitations:
TensorStore.read()._METADATA and .zarray as security-sensitive scanner targets.