Hugging Face Hub — Pickle Scanning documentation
spec-sheet
Fields
id
sources/meth-huggingface-pickle-securityPublisher
Hugging Face
Kind
spec-sheet
Published
2024-01-01
Accessed
2026-10-04
notes
Verified: HuggingFace documentation confirms that pickle is the default format for PyTorch model weights and that 'there are dangerous arbitrary code execution attacks that can be perpetrated when you load a pickle file.' The Hub runs a Pickle Import scan using pickletools.genops to extract imports without executing code. The docs recommend safetensors as a safe alternative. The fickling library (trailofbits) is referenced as a tool for analyzing malicious pickles.
Notes
Verified: HuggingFace documentation confirms that pickle is the default format for PyTorch model weights and that 'there are dangerous arbitrary code execution attacks that can be perpetrated when you load a pickle file.' The Hub runs a Pickle Import scan using pickletools.genops to extract imports without executing code. The docs recommend safetensors as a safe alternative. The fickling library (trailofbits) is referenced as a tool for analyzing malicious pickles.
Cross-references
This record references no other records.