PickleBall: Secure Deserialization of Pickle-based Machine Learning Models
Andreas D. Kellas, Neophytos Christou, Wenxin Jiang, Penghui Li, Laurent Simon, Yaniv David, Vasileios P. Kemerlis, James C. Davis, Junfeng Yang
Abstract
Machine learning model repositories, such as the Hugging Face Model Hub, facilitate model exchanges. However, bad actors can deliver malware through compromised models. Existing defenses, such as safer model formats, restrictive (but inflexible) loading policies, and model scanners, have shortcomings: 44.9% of popular models on Hugging Face still use the insecure pickle format, 15% of these cannot be loaded by restrictive loading policies, and model scanners have both false positives and false negatives. Pickle remains the de facto standard for model exchange, and the ML community lacks a tool that offers transparent safe loading. We present PickleBall to help machine learning engineers load pickle-based models safely. PickleBall statically analyzes the source code of machine learning libraries and computes custom policies that specify a safe load-time behavior for benign models. It then dynamically enforces these policies during load time as a drop-in replacement for the pickle module. PickleBall generates policies that correctly load 79.8% of benign pickle-based models in our dataset, while rejecting all (100%) malicious examples in the same dataset. In comparison, evaluated model scanners fail to identify known malicious models, and the state-of-the-art loader loads 22% fewer benign models than PickleBall. PickleBall removes the threat of arbitrary function invocation from malicious pickle-based models, raising the bar for attackers as they have to depend on code reuse techniques.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Interoperability in Deep Learning: A User Survey and Failure Analysis of ONNX Model Converters cites An Empirical Study of Pre-Trained Model Reuse in the Hugging Face Deep Learning Model Registry
- Interoperability in Deep Learning: A User Survey and Failure Analysis of ONNX Model Converters cites An Exploratory Study of Deep learning Supply Chain
Cited by top-tier papers1
Builds on12
- An Empirical Study of Pre-Trained Model Reuse in the Hugging Face Deep Learning Model RegistryWenxin Jiang, Nicholas Synovic, Matt Hyatt, Taylor R. Schorlemmer et al.ICSE 2023 · 62 citations
- An Exploratory Study of Deep learning Supply ChainXin Tan, Kai Gao, Minghui Zhou, Li ZhangICSE 2022 · 32 citations
- Interoperability in Deep Learning: A User Survey and Failure Analysis of ONNX Model ConvertersPurvish Jajal, Wenxin Jiang, Arav Tewari, Erik Kocinare et al.ISSTA 2024 · 19 citations
- The Art of Hide and Seek: Making Pickle-Based Model Supply Chain Poisoning Stealthy AgainTong Liu, Guozhu Meng, Peng Zhou, Zizhuang Deng et al.USENIX Security 2026 · 6 citations
- RogueOne: Detecting Rogue Updates via Differential Data-flow Analysis Using Trust DomainsRaphael J. Sofaer, Yaniv David, Mingqing Kang, Jianjia Yu et al.ICSE 2024 · 3 citations
Related papers
- On the (In)Security of Loading Machine Learning ModelsGabriele Digregorio, Marco Di Gennaro, Stefano Zanero, Stefano Longari et al.S&P 2026 · 3 citations
- DRSM: De-Randomized Smoothing on Malware Classifier Providing Certified RobustnessShoumik Saha, Wenxiao Wang, Yigitcan Kaya, Soheil Feizi et al.ICLR 2024 · 6 citations
- Signing in Four Public Software Package Registries: Quantity, Quality, and Influencing FactorsTaylor R. Schorlemmer, Kelechi G. Kalu, Luke Chigges, Kyung Myung Ko et al.S&P 2024 · 17 citations
- Bad Snakes: Understanding and Improving Python Package Index Malware ScanningDuc-Ly Vu, Zachary Newman, John Speed MeyersICSE 2023 · 18 citations
- MalGuard: Towards Real-Time, Accurate, and Actionable Detection of Malicious Packages in PyPI EcosystemXingan Gao, Xiaobing Sun, Sicong Cao, Kaifeng Huang et al.USENIX Security 2025
