How the model security scanner reads pickle files
Published10 min read▲ 198
Legacy PyTorch checkpoints are pickle files, and pickle can execute code on load. The scanner walks the opcode stream without executing it and reports any import that is not on an allow-list.
What gets flagged
Imports such as os.system or builtins.exec are marked as dangerous, and the inference widget refuses to run the model until the owner converts it to safetensors.