WeaknessASC-2026-0013Major weakness
Unsafe model serialization (pickle)
CriticalFixed
Pickle-based model files (.pkl, .pt, .pth, .bin, .ckpt) can run arbitrary code the moment they are loaded.
How to detect it
- Model file uses a pickle-based format
- The pickle imports callables such as os.system, subprocess or builtins.eval
How to resolve it
- Convert weights to safetensors and load only safetensors in production
- When pickle is unavoidable, load with torch.load(weights_only=True) (the default since PyTorch 2.6)
- Scan every model file before loading and verify the publisher's hash
How to investigate
- Scan all model files on the host with the model file scanner
- Check hosts that loaded the file for unexpected processes and outbound connections
- Compare file hashes with the publisher's and remove unverified copies