picklescan
Security scanner detecting Python Pickle files performing suspicious actions
What it is and what it does
Picklescan is a command-line security tool that inspects Python Pickle files and related serialized formats (like PyTorch models) to identify dangerous operations before you load them. Pickle's design allows arbitrary code execution during deserialization, making untrusted pickles a significant security risk in machine learning workflows. The scanner reports specific dangerous globals and operations it finds, using exit codes compatible with security scanning tools like ClamAV.
It works with local files, directories, remote URLs, and zip archives (common in PyTorch model distribution). You can filter scans by file patterns and directory traversal rules. The tool has no runtime dependencies and runs as a standalone CLI, making it easy to integrate into CI/CD pipelines or pre-download security checks for models from sources like Hugging Face.
Use it for:
- Verify downloaded PyTorch or other ML models from Hugging Face before loading them in your training pipeline.
- Scan model directories in CI/CD to block commits or deployments of pickles with detected dangerous operations.
- Audit local pickle files or model repositories for suspicious code patterns before sharing or using them.
- Integrate into model download workflows to automatically check remote URLs for malicious payloads.
- Screen .npy numpy files alongside pickles when auditing scientific data or model checkpoints.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Scans Python Pickle files and related serialized model formats to detect suspicious or malicious code execution patterns before loading them.
Yes. If you work with untrusted or community-sourced pickle files—especially ML models—this tool fills a real security gap with zero installation friction and active maintenance. No dependencies, straightforward CLI, and clear exit codes make it suitable for both manual inspection and automation. Install it.
Install
picklescan on PyPI
pip
pip install picklescanuv
uv add picklescanpoetry
poetry add picklescanInstalling picklescan
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with a recent release 44 days ago and steady repository activity.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal legal friction.
Quickstart
pip install picklescan
picklescan --path model.pkl
# or scan from Hugging Face:
picklescan --huggingface username/model-name
Requires Python 3.11 or later. Optional: install numpy to scan .npy files.
Verify before relying
- Effectiveness of detection heuristics against novel or obfuscated pickle exploits remains unquantified.
- Performance characteristics when scanning very large model files or directories with thousands of files.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 44 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,871/month — #13,497 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: picklescan-1.0.5-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
ficklingFickling is a decompiler, static analyzer, and…
copyleft · top 5,000 on PyPI
pypicklepypickle wraps Python's pickle module to save…
permissive · top 15,000 on PyPI
safetySafety CLI scans Python project dependencies…
permissive · top 5,000 on PyPI
scanossScanoss provides a Python library and CLI tool…
permissive · top 15,000 on PyPI
cisco-ai-mcp-scannerScans MCP (Model Context Protocol) servers and…
unclear · top 15,000 on PyPI
dodgyDodgy scans Python source code for suspicious…
permissive · top 15,000 on PyPI
pdfidAnalyzes PDF files to identify potentially…
permissive · top 15,000 on PyPI
cisco-ai-skill-scannerScans AI Agent Skills for prompt injection,…
permissive · top 15,000 on PyPI
guarddogGuardDog is a CLI tool that scans PyPI, npm,…
permissive · top 15,000 on PyPI
pyClamdpyClamd provides a Python interface to the…
copyleft · top 15,000 on PyPI