# In a pickle: Why every pickle defense in machine learning is bypassed the same way

DevFeed: [In a pickle: Why every pickle defense in machine learning is bypassed the same way](<https://devfeed.tech/articles/in-a-pickle-why-every-pickle-defense-in-machine-learning-is-bypassed-the-same-way-102875.md>)

Original publisher: [Read original article](<https://webflow.sysdig.com/blog/in-a-pickle-why-every-pickle-defense-in-machine-learning-is-bypassed-the-same-way>)

Author: Lydia Graslie

Published: 2026-10-27T00:00:00Z

Content type: article

Language: en

Sources: [Sysdig](<https://devfeed.tech/sources/sysdig-blog.md>)

Topics: [Adversarial attacks](<https://devfeed.tech/topics/adversarial-attacks.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Keras](<https://devfeed.tech/topics/keras.md>), [model-deployment](<https://devfeed.tech/topics/model-deployment.md>), [MLOps](<https://devfeed.tech/topics/mlops.md>), [hugging face](<https://devfeed.tech/topics/hugging-face.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>)

Tags: [ai-supply-chain-security](<https://devfeed.tech/tags/ai-supply-chain-security.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [blast-radius](<https://devfeed.tech/tags/blast-radius.md>), [bypass](<https://devfeed.tech/tags/bypass.md>), [ci](<https://devfeed.tech/tags/ci.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [cve-2025-32434](<https://devfeed.tech/tags/cve-2025-32434.md>), [cve-2026-24747](<https://devfeed.tech/tags/cve-2026-24747.md>), [falco](<https://devfeed.tech/tags/falco.md>), [keras](<https://devfeed.tech/tags/keras.md>), [keras-safe-mode-bypass](<https://devfeed.tech/tags/keras-safe-mode-bypass.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [malicious-pickle-files](<https://devfeed.tech/tags/malicious-pickle-files.md>), [ml-model-security](<https://devfeed.tech/tags/ml-model-security.md>), [nullifai](<https://devfeed.tech/tags/nullifai.md>), [pickle-deserialization](<https://devfeed.tech/tags/pickle-deserialization.md>), [picklescan](<https://devfeed.tech/tags/picklescan.md>), [pytorch](<https://devfeed.tech/tags/pytorch.md>), [pytorch-weights-only-bypass](<https://devfeed.tech/tags/pytorch-weights-only-bypass.md>), [runtime-detection](<https://devfeed.tech/tags/runtime-detection.md>), [safetensors](<https://devfeed.tech/tags/safetensors.md>), [sysdig-secure](<https://devfeed.tech/tags/sysdig-secure.md>)

## AI overview

Python pickle files are executable programs: loading one can run code through its reconstruction instructions, even if the file is malformed after the payload. The excerpt describes six documented bypasses across PyTorch restricted loading, Keras safe_mode, and picklescan; the common weakness is that scanners and loaders interpret the same bytes differently. It identifies safetensors as structurally unable to express a callable, while GGUF and ONNX have no known code execution path but are not presented as proven safe. For models that still require pickle, the recommended layers are current loader versions (PyTorch 2.10.0+; reject legacy Keras .h5; keep NumPy allow_pickle=False), CI scanning, provenance checks, sandboxed loading with restricted egress and no valuable credentials, and runtime monitoring. Runtime monitoring observes downstream effects rather than deserialization itself: the test found all five gadget families triggered Sysdig Secure and four triggered Falco 0.44.1 defaults, with the tested rules detecting activity such as file reads or outbound connections, not the pickle load.

## Source excerpt

Six documented bypasses beat PyTorch weights_only, Keras safe_mode, and picklescan. See which ML formats are safe and what runtime detection catches.