Triple-Stage AI Attack Chain Hits PyTorch
Black Hat Asia 2026 demo turns PyTorch TorchScript as_strided heap underflow into RCE even with weights_only=True, and shows it against OpenSearch.
7 min read

Visual TL;DR
an attacker supplied torch checkpoint opened by a victim application
From the article 6 mentionsTwo independent researchers demoed a triple-stage AI attack chain at Black Hat Asia 2026 that turns a PyTorch model file into remote code execution even with weights_only set to True.
model file to memory corruption to remote code execution in three linked steps
From the articleTwo independent researchers demoed a triple-stage AI attack chain at Black Hat Asia 2026 that turns a PyTorch model file into remote code execution even with weights_only set to True.
researchers demonstrated the full chain against a live OpenSearch deployment on stage
mode docs called secure but still dispatches to torch.jit.load on TorchScript
From the article 5 mentionsThe researchers found torch.load with weights_only=True still calls torch.jit.load if the file is TorchScript format, and TorchScript exposes high-risk operators like torch.save and torch.from_file.
C++ memory safety underflow in the as_strided operator exposed to loading path
From the articleCalling the API directly in Python reproduced the bug, but saving it via forward into a TorchScript file and reloading with torch.load with weights_only True initially hid it.
an attacker supplied torch checkpoint opened by a victim application
From the article 6 mentionsTwo independent researchers demoed a triple-stage AI attack chain at Black Hat Asia 2026 that turns a PyTorch model file into remote code execution even with weights_only set to True.
mode docs called secure but still dispatches to torch.jit.load on TorchScript
From the article 5 mentionsThe researchers found torch.load with weights_only=True still calls torch.jit.load if the file is TorchScript format, and TorchScript exposes high-risk operators like torch.save and torch.from_file.
C++ memory safety underflow in the as_strided operator exposed to loading path
From the articleCalling the API directly in Python reproduced the bug, but saving it via forward into a TorchScript file and reloading with torch.load with weights_only True initially hid it.
attacker controls arbitrary read and write over process memory via crafted strides
From the articleA second check rejects storage_offset less than zero, which is why minus 1 fails but 2^62 minus 1 succeeds and returns 0x41, the glibc heap chunk header, confirming an underflow.
model file to memory corruption to remote code execution in three linked steps
From the articleTwo independent researchers demoed a triple-stage AI attack chain at Black Hat Asia 2026 that turns a PyTorch model file into remote code execution even with weights_only set to True.
model serialization changes broke the researchers first weaponized proof of concept
researchers pivoted from pickle RCE to native code execution through the underflow primitive
researchers demonstrated the full chain against a live OpenSearch deployment on stage
Contents(8)
© 2026 StartupHub.ai. All rights reserved. Do not enter, scrape, copy, reproduce, or republish this article in whole or in part. Use as input to AI training, fine-tuning, retrieval-augmented generation, or any machine-learning system is prohibited without written license. Substantially-similar derivative works will be pursued to the fullest extent of applicable copyright, database, and computer-misuse laws. See our terms.