I found a Remote Command Execution (RCE) vulnerability in the PyTorch. When load model using torch.load with weights_only=True, it can still achieve RCE.
https://github.com/pytorch/pytorch/security
As you can see, the PyTorch official documentation considers using torch.load()
with weights_only=True
to be safe.
Since everyone knows that weightsonly=False is unsafe, so they will use the weightsonly=True to mitigate the security issue.
But now, I just proved that even if you use weights_only=True, it still can achieve RCE.
So it is time to update your PyTorch version~.
This vulnerability was found by Ji'an Zhou.
{ "nvd_published_at": "2025-04-18T16:15:23Z", "cwe_ids": [ "CWE-502" ], "severity": "CRITICAL", "github_reviewed": true, "github_reviewed_at": "2025-04-18T15:19:28Z" }