Views
No views yet
/tmp/PWNED_BY_PT_LEGACY).torch.save(obj, path, _use_new_zipfile_serialization=False) writes a raw
PROTO-2 pickle (the legacy non-zipfile format that PyTorch < 1.6 used by default
and that current PyTorch still emits when callers pass the legacy flag, or load
old checkpoints from libraries pinned to old torch).modelscan dispatches by file extension: .pt -> PyTorchUnsafeOpScan.
That scanner assumes the modern zipfile-wrapped format and reports "No issues
found" on a legacy-format .pt even when the embedded pickle calls
os.system(...) via __reduce__. torch.load(path, weights_only=False)
unpickles normally and runs the constructor.1pip install torch modelscan
2modelscan -p poc_legacy.pt # No issues found!
3python3 -c "import torch; torch.load('poc_legacy.pt', weights_only=False)"
4ls /tmp/PWNED_BY_PT_LEGACY # sentinel file written