fix(routing): prefer validated safetensors framing - #1612
Conversation
Performance BenchmarksCompared
|
…fetensors-protocol-routing
|
Coordinator sidecar review on exact head found two blocking issues:
Recommended fix shape: resolve SafeTensors/pickle overlap centrally and prefer pickle, dual scanning, or an explicit fail-closed / inconclusive result when a structurally valid dangerous pickle also exists; do not return before the existing TensorFlow guard runs. |
|
Coordinator sidecar review on exact head 76bdfc0 found two blocking issues.
Recommended fix shape: resolve SafeTensors/pickle overlap centrally and prefer pickle, dual scanning, or an explicit fail-closed or inconclusive result when a structurally valid dangerous pickle also exists; do not return before the existing TensorFlow guard runs. |
Route structurally valid protocol collisions to the scanners that can safely inspect them while keeping benign near-matches on the safetensors path. Preserve overlap findings across nested archives and scanner selection, with bounded pickle and compression probes.
…fetensors-protocol-routing # Conflicts: # modelaudit/utils/file/detection.py # tests/utils/file/test_filetype.py
Keep reusable-context and unloaded-frozen-module tests independent of modules and meta-path finders loaded during full-suite collection.
|
Current head: |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Current head: |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
STACK_GLOBAL; STOPCampaign evidence
The Hugging Face campaign found valid SafeTensors shards routed as pickle or
pickle_routing_inconclusivebecause the little-endian header length also formed a protocol-less pickle prefix. The strong SafeTensors frame validation was only reached after the weaker pickle probe.This is separate from the zlib collision fixed in #1610.
Validation
origin/main:detect_file_format(...) == "pickle"pytest -q tests/utils/file/test_filetype.py tests/test_core.py -k 'protocolless or pickle_shaped_safetensors'(37 passed)