Repository navigation
pickle-sentry 0.2.0
pickle-sentry 0.2.0
First public release. Scan code and dataset files for unsafe pickle deserialization — including the Hugging Face datasets pandas builder RCE, CVE-2026-57845 (CVSS 8.8, affects datasets ≤ 5.1.0, no patched upstream release yet). Inspected pickle files are never executed — inspection is disassembly only.
What it catches
load_dataset("pandas", ...)→ critical, tagged CVE-2026-57845pickle/dill/cloudpickle/marshal/shelve/joblibloading,pandas.read_pickletorch.loadwithoutweights_only=True,numpy.load(..., allow_pickle=True), unsafeyaml.load- Pickle files whose
REDUCEcalls dangerous callables (os.system,subprocess.*,eval,exec…) — critical - Pickle files invoking non-standard callables via
REDUCE— the exact shape of the published CVE PoC payload — high - The pickle stream inside torch
.pt/.pth/pytorch_model.binzip archives
Modes
pickle-sentry <path>— AST-scan a codebase and inspect its pickle filespickle-sentry hub <user/repo> [--repo-type model]— scan a Hugging Face Hub repo the same way, before you load anything from it- Text / JSON / SARIF output,
--fail-onthresholds for CI,--excludefor triage, a composite GitHub Action, and a pre-commit hook
Proof, not promises
docs/LIVE-EXAMPLES.md: live scans of huggingface/datasets (exactly one production finding — the CVE sink atpandas.py:56) and scikit-learndocs/USE-CASE.md: scanning the actual published CVE-2026-57845 PoC repository — payload flagged by name, and the PoC's ownmarker.txtproves it never executed during the scan- 21 tests, including a canary test proving a malicious pickle is flagged without being run
Install: pip install pickle-sentry