vulnerability Critical vulnerability in PyTorch framework Researchers have found a way to exploit a security mechanism in a popular machine-learning framework. Editorial Team April 21, 2025 A researcher has discovered a vulnerability in PyTorch – an open-source machine-learning framework. The vulnerability, registered as CVE-2025-32434, belongs to the Remote Code Execution (RCE) class, and has a 9.3 CVSS rating, meaning it’s categorized as critical. Exploitation of CVE-2025-32434 under certain conditions allows an attacker to run arbitrary code when a malicious AI model is being loaded on the victim’s computer. Anyone using PyTorch is advised to update the framework to the latest version as soon as possible. The CVE-2025-32434 vulnerability Among other things, the PyTorch framework, allows users to save trained models to a file that stores the weights, and loads them from the file using the torch.load() function. Trained models are often shared via various public repositories and, theoretically, they can contain malicious implants. Therefore, the official documentation of the PyTorch project recommends using the torch.load() function with the weights_only=True parameter for security purposes (this way, only primitive data types are loaded: dictionaries, tensors, lists, and so on). The vulnerability CVE-2025-32434 exists due to an incorrectly implemented deserialization mechanism when loading a model. The researcher who discovered it demonstrated that an attacker can create a model file in such a way that the weights_only=True parameter will lead to the exact opposite effect, while the loading of this malicious model will lead to arbitrary code execution that can compromise the environment in which the model is run. How to stay safe? The researcher didn’t publish a detailed method for exploiting this vulnerability, and at the moment there’s no evidence that someone is using CVE-2025-32434 in actual attacks. However, the very fact of releasing a patch always attracts both researchers and attackers to the problem, so proof-of-concept exploits are most likely already being developed. The team responsible for developing the PyTorch framework released its update 2.6.0, in which the vulnerability CVE-2025-32434 was successfully fixed. All previous versions – up to 2.5.1 – remain vulnerable and should be updated as soon as possible. If this isn’t possible for some reason, the researchers recommend refraining from using the torch.load() function with the weights_only=True parameter, and temporarily switching to alternative methods of model loading. In addition, we recommend paying special attention to protecting virtual and cloud environments – the easiest way to do this is by using specialized solutions.
Read next CISO priorities in 2025 Analyzing the popular CISO MindMap from an economic efficiency perspective.
Tips Reading between the lines: how to read ebooks safely We break down how to use ebooks safely and which rules to follow when searching for books online, so you don’t fall victim to scammers
Tips The eMudhra certificate incident: how organizations can respond How a certificate’s private key ended up being equal to 4, and why browser updates alone won’t protect you from vulnerable eMudhra certificates.
Tips How to improve your resume with AI without exposing your data Let’s look at how to use AI as a resume editor without oversharing to build a document that gets past automated screening systems and catches a recruiter’s eye.
Tips How can students overcome the fear of unfulfilled potential, and where does cybersecurity come into it? University students sometimes don’t see the practical value of what they’re studying, and aren’t always sure what to do next. Kaspersky Academy’s free “Cybersecurity. Entry Level” course can help them pick up in-demand skills directly from Kaspersky experts.