Skip to content

pickle-sentry 0.3.0

Choose a tag to compare

@Sun-Wukhan Sun-Wukhan released this 11 Nov 02:25
· 7 commits to main since this release

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: .npy object arrays (payload analysed as pickle; fixed-width arrays are info-level), .npz per member, .keras configs checked for marshal-loading Lambda layers (high), .safetensors and .gguf header-level info checks.
  • Hub mode now also inspects .npy, .npz, .keras and .gguf files (.safetensors is 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