Views
No views yet
.pt2 AOTInductor Zip-Slip Path Traversal PoC.pt2 package loader (AOTIModelPackageLoader in torch/csrc/inductor/aoti_package/model_package_loader.cpp) performs a zip extraction with a simple prefix check (starts_with(cur_filename, model_directory)) and does not validate canonical containment of the destination path. A malicious archive member like:aoti_zip_slip/data/aotinductor/model/../../../../../PT2_AUDIT.txtdata/aotinductor/model) and is extracted to /tmp/PT2_AUDIT.txt during torch._inductor.package.load_package() / aoti_load_package()..pt2 model file consumed by AOTInductor.pytorch/pytorch master @ commit 44c2904880ec08f4ea80e794e2883fb731a3d87f (2026-05-12)torch 2.11.0 (commit 70d99e998b4955e0049d13a98d77ae1b14db1f45)torch/csrc/inductor/aoti_package/model_package_loader.cpp — AOTIModelPackageLoader extract loop uses starts_with(cur_filename, model_directory) plus extract_file(zip_filename_str, temp_dir + "/" + cur_filename) with no canonical-containment checktorch/_inductor/package/package.py falls back to the raw C++ loader after a benign-looking RuntimeErrortorch._inductor.package.load_package(path, "model") and torch._inductor.aoti_load_package(path)1python3 poc_aoti_zip_slip.py
2cat /tmp/PT2_AUDIT.txt # AOTI .pt2 ZIP SLIP SENTINELarchive=/tmp/pt2-audit/aoti_zip_slip.pt2
entries:
aoti_zip_slip/data/aotinductor/model/dummy.txt
aoti_zip_slip/data/aotinductor/model/../../../../../PT2_AUDIT.txt
returncode=0
RuntimeError: Failed to find a generated cpp file or so file for model 'model' in the zip archive.
sentinel_exists True
AOTI .pt2 ZIP SLIP SENTINEL.cpp/.so artifacts.aoti_zip_slip.pt2 — minimal malicious .pt2 (1,636 B)poc_aoti_zip_slip.py — reproducer harnesspoc_aoti_zip_slip.out — captured stdout/stderrtorch.load() legacy .pt pickle issuestorch.package.PackageImporter.ptl Lite Interpreter (separate audit F-050)torch.jit.load.mar archivestorch.export.experimental extraction surface. This finding targets the C++ AOTIModelPackageLoader miniz extraction in torch._inductor.package / aoti_load_package. Different files, different APIs, different vulnerable code paths. Verified by GitHub-connector searches for AOTIModelPackageLoader path traversal, model_package_loader extract_file traversal — no matches..pt2 pickle/torch.load duplicates ("RCE via torch.load weights_only=False", "RCE in torch.export.load via Unsafe Deserialization", "weights_only=False Silent Fallback in ExportedProgram Deserialization").model_package_loader.cpp extraction loop, canonicalize the destination path before extracting and reject any member whose canonical path is not below the extraction root. Also reject archive member names containing .., absolute paths, or Windows drive prefixes. Require the prefix check to include a directory boundary (data/aotinductor/<model_name>/, not just data/aotinductor/<model_name>).lendtrain (huntr) / tonydav41 (HuggingFace). Filed 2026-05-12.