Model Files → Memory Corruption → RCE: The Triple-Stage AI Attack Chain
summary
Claims a reproducible three-stage chain that turns malicious TorchScript model files into reliable RCE on PyTorch: a 64-bit integer overflow in the storage offset check (2^62-1 overflow) creates a heap underflow, a crafted heap spray plus pattern scanning gains control of a storage_impl data_ptr (storage_impl data_ptr overwrite) to build arbitrary read/write, leaking libc and overwriting a destructor to trigger system via delete. Tooling: GDB, torch.save/torch.load, torch.jit, and OpenSearch integration; local exploit works, cloud service blocks remote registration.
AI-written summary · about
chapters (14)
- 0:00Introduction to AI attack chain
- 2:14Historical model loading risks
- 3:38Targeting PyTorch framework
- 6:09PyTorch weights_only parameter
- 7:58PyTorch memory layout
- 12:57Hunting memory vulnerabilities
- 14:22Heap underflow vulnerability
- 19:01Exploiting memory corruption
- 24:19Live RCE demonstration
- 25:00Attacking OpenSearch AI
- 31:11Heap overflow in OpenSearch
- 33:15Vendor response and mitigations
- 34:20Security recommendations
- 35:44Summary and future risks
