CVE-2026-4538: PyTorch Vulnerability in pt2 Loading Deserialization
Summary
CVE-2026-4538: PyTorch pt2 Loading deserialization. Affects pytorch versions >= 2.10.0, < 2.11.0. Fixed in 2.11.0. How to fix ↓
Also tracked for
- torch · PyPI
The same CVE-2026-4538 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PyTorch is an open-source machine learning library widely used for applications such as computer vision and natural language processing. It provides a flexible and efficient platform for building deep learning models. The library's pt2 Loading Handler is responsible for deserializing model components, which is crucial for loading pre-trained models. However, a vulnerability has been identified in version 2.10.0 that exposes the library to potential local attacks.
Vulnerability Detail
A vulnerability was discovered in PyTorch version 2.10.0, specifically within the pt2 Loading Handler. This vulnerability allows for deserialization attacks, which can lead to unauthorized code execution or data manipulation. The attack can only be executed from a local environment, making it a localized threat. The exploit is publicly available, and although the maintainers were informed of the issue through a pull request, no action has been taken to address it as of yet.
How To Fix
Minimum fixed version
2.11.0
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, users can avoid loading untrusted models or data using the pt2 Loading Handler until the package is updated to a secure version. This will help mitigate the risk of exploitation.
Conclusion
In summary, CVE-2026-4538 is a significant vulnerability in PyTorch 2.10.0 that allows for local deserialization attacks. Users are strongly advised to update to version 2.11.0 or later to mitigate the risks associated with this vulnerability. Until an update can be applied, it is recommended to avoid loading untrusted models.
See every vulnerability recorded for pytorch →
FAQ
CVE-2026-4538 is a vulnerability in PyTorch 2.10.0 that allows for deserialization attacks through the pt2 Loading Handler.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If an immediate update is not possible, avoid loading untrusted models or data to minimize the risk of exploitation.
Yes, the exploit for this vulnerability is publicly available, which increases the urgency for users to update their PyTorch installations.
The vulnerability could lead to unauthorized code execution or data manipulation, posing significant security risks to applications using the affected version of PyTorch.
References
Related vulnerabilities
Recent vulnerabilities recorded for pytorch.