Repository navigation
Releases
pickle-sentry 0.5.0
pickle-sentry 0.5.0 — invoked stdlib command-execution globals now flag critical
New rule PICKLE-INVOKED-DANGEROUS-GLOBAL (critical): the scanner's abstract interpreter now classifies command-execution-capable stdlib globals as dangerous only when a payload actually invokes them (REDUCE / NEWOBJ / INST). The set follows Wiz's analysis of GHSA-g38g-8gr9-h9xp: uuid._get_command_stdout, _osx_support._read_output, _osx_support._find_build_tool, _aix_support._read_cmd_output, _pyrepl.pager.pipe_pager, _pyrepl.pager.tempfile_pager, imaplib.IMAP4_stream, test.support.script_helper.assert_python_ok / assert_python_failure.
This is invocation precision, not a bigger blocklist: a pickle that merely references one of these globals is NOT flagged high, and benign neighbours such as uuid.uuid4 stay unflagged.
- Benchmark, same corpus, same criteria: malicious caught 75 → 76 / 96, benign false flags unchanged (5 / 24), zero regressions. The newly caught file is the
uuidGHSA fixture (uuid.was previously swallowed by the benign-prefix list); the other five GHSA-g38g fixtures, already flagged high, now flag critical under the precise rule. Remaining GHSA misses invoketorch.*/numpy.*globals — a different class, stated plainly in docs/BENCHMARK.md. - 19 new tests: for each target global, an invoking payload flags critical and a referencing payload does not flag high, plus a canary proving an invoking payload is flagged but never executed. 113 tests total, zero dependencies, Python 3.9+.
Install: pip install pickle-sentry==0.5.0
pickle-sentry 0.4.1
pickle-sentry 0.4.1 — standalone archives are now actually inspected
A routing fix, found by the published benchmark (docs/BENCHMARK.md, miss category 1): eight of Picklescan's malicious fixtures — a zip, six zip variants and a 7z — previously received no findings at all, because the CLI never routed their extensions to the inspector that already knew how to peel them.
pickle-sentry <path>now routes.zip,.tar,.tgz,.gz,.bz2,.xzand.7zfiles to the inspector, and.binjoins the inspected set (torch / Hugging Face.binfiles are pickle streams or torch zips; hub mode already inspected them).- Magic-byte sniffing for files whose extension routes nowhere: zip, 7z, gzip, bzip2, xz and tar signatures and the pickle protocol marker are recognised from the first 512 bytes, so a container hiding behind a wrong extension is inspected instead of skipped.
- Benchmark, same corpus, same criteria: malicious caught 71 → 75 / 96, benign false flags unchanged (5 / 24), zero regressions. The five damaged/encrypted zip variants now report a medium finding instead of silence; details in the benchmark's 0.4.1 re-run section.
- 15 new routing tests, all fixtures generated in-test, including a canary proving a hostile payload inside a zip is flagged, never executed. 94 tests total, zero dependencies, Python 3.9+.
Install: pip install pickle-sentry==0.4.1
pickle-sentry 0.3.1
pickle-sentry 0.3.1 — metadata fix
Metadata-only release. No scanner behaviour changes.
- PyPI trove classifiers added (Python 3.9–3.13) so the Python versions badge renders correctly instead of "missing"
- GitHub Action: default
versioninput bumped to 0.3.1; README examples pinned toSun-Wukhan/pickle-sentry@v0.3.1 - SECURITY.md supported versions corrected to 0.3.x
60 tests, zero dependencies, Python 3.9+. Install: pip install pickle-sentry==0.3.1
pickle-sentry 0.3.0
pickle-sentry 0.3.0 — depth and formats
The pickle inspector is now an abstract interpreter, and four non-pickle artifact formats are checked natively.
- VM-tracking analysis: a symbolic stack over the pickle disassembly resolves which callables a pickle actually invokes (REDUCE / NEWOBJ / INST), tracking values through the memo and STACK_GLOBAL — defeating the memo evasion where the callable is hidden and fetched only at REDUCE time. Invocation rules are now precise: a dangerous global that is merely referenced is reported, but never as an invocation.
- Container peeling: gzip, bzip2, xz and zlib wrappers are decompressed and inspected; zip and tar members that look like pickle streams are inspected whatever their filename; pickle streams nested inside pickle bytes constants are analysed recursively. 7-Zip archives cannot be read with the standard library, so they are flagged
PICKLE-CONTAINER-OPAQUE(high) — the opaque-container route used by the NullifAI Hub-scanner evasion. - New formats:
.npyobject arrays (payload analysed as pickle; fixed-width arrays are info-level),.npzper member,.kerasconfigs checked for marshal-loading Lambda layers (high),.safetensorsand.ggufheader-level info checks. - Hub mode now also inspects
.npy,.npz,.kerasand.gguffiles (.safetensorsis not downloaded in hub mode — see docs/FORMATS-AND-DEPTH.md).
60 tests, zero dependencies, Python 3.9+. Full details: CHANGELOG.md and docs/FORMATS-AND-DEPTH.md in the repository.
Install: pip install pickle-sentry==0.3.0
pickle-sentry 0.2.1
pickle-sentry 0.2.1
Adoption and CI/CD release. No scanner-rule changes.
- GitHub Action hardened: installs the pinned PyPI release instead of an unpinned Git checkout; new inputs
output,exclude(comma-separated),version,python-version; Marketplace branding added. - CI/CD guide (
docs/CI-CD.md): exit-code contract (0 pass, 1 threshold reached, 2 scan error) and copy-ready pipelines for GitHub Actions (including SARIF upload to code scanning), GitLab CI, Azure Pipelines, and Jenkins underexamples/cicd/. - Worked supply-chain example: a pipeline that downloads the existing
datasets==5.1.0wheel without installing it, extracts it, and fails on the real CVE-2026-57845 sink atpandas.py:56(docs/EXISTING-PACKAGE-EXAMPLE.md). - Demo + README: animated terminal demo, quick start, and an honest comparison table — pickle-sentry scans the code that loads pickles and the packages you are about to install, alongside model-file scanning.
Full changelog: CHANGELOG.md in the repository.
Install: pip install pickle-sentry==0.2.1
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