Downloads · 30 days
0
htdy7703/safetensors-metadata-header-bomb-poc
safetensors-metadata-header-bomb-poc is a machine learning model from htdy7703. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This PoC shows that the shipped safetensors 0.8.0 wheel can exhaust memory during safeopen(...) header parsing with a header-only file that contains no tensors and only a huge metadata map.
Downloads · 30 days
0
Access
Public
Updated Jul 8, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 42%
From the Hugging Face model README
This PoC shows that the shipped safetensors 0.8.0 wheel can exhaust memory during safe_open(...) header parsing with a header-only file that contains no tensors and only a huge __metadata__ map.
What this shows:
safe_open(..., framework="np") can abort before any tensor materialization4,000,000 entry metadata map is enough to make a 58,888,916 byte file fail under a 900 MB address-space limitget_tensors() zero-sized-tensor bomb because this file contains zero tensorsWhat this does not show:
Verified runtime:
safetensors 0.8.0numpy 2.5.1Run python3 reproduce.py.