PyTorch Package extensionless resource PoC
This benign PoC is a valid torch.package artifact where an attacker-controlled pickle is stored as an extensionless inner resource (payload) and later consumed by PackageImporter.load_pickle.
Files
model/evil_extless.pt— validtorch.packageartifact, minimized (1435bytes)model/build-meta.json— measurement summary and hash datareproduce/replay_torch_package_extless.py— replay throughmodelscanandPackageImporter
What it demonstrates
With torch==2.3.1+cpu and modelscan==0.8.8, ModelScan reports 0 issues and 0 scanned files for model/evil_extless.pt, while PackageImporter.load_pickle("res", "payload") loads the same artifact and writes the benign marker torch-package-extensionless-resource-bypass.
Quick repro
Install modelscan==0.8.8 and torch==2.3.1+cpu, then run:
pip install modelscan==0.8.8
pip install --index-url https://download.pytorch.org/whl/cpu torch==2.3.1
python reproduce/replay_torch_package_extless.py --artifact model/evil_extless.pt --resource payload
This PoC is for defensive validation and bug-bounty triage only.