TorchServe Pre-Auth Remote Code Execution in torchserve
Summary
GHSA-4mqg-h5jf-j9m7: TorchServe Pre-Auth Remote Code Execution. Affects torchserve versions >= 0.3.0, < 0.8.2. Fixed in 0.8.2. How to fix ↓
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
TorchServe is an open source library used for serving PyTorch models in production. It provides a lightweight, flexible, and easy-to-use model serving environment. TorchServe versions 0.3.0 to 0.8.1 are affected by a vulnerability that exposes users to unsafe deserialization of Java objects. This can potentially allow third parties to execute arbitrary code on the target system.
Vulnerability Detail
The vulnerability in TorchServe arises from the use of a version of the SnakeYAML library (v1.31) with multiple issues. These issues can lead to unsafe deserialization of Java objects, enabling attackers to execute arbitrary code on the target system. This poses a significant security risk as it allows unauthorized remote code execution, potentially leading to data breaches, system compromise, and unauthorized access to sensitive information.
How To Fix
Latest published version: 0.12.0 as of 22 Oct 2026
pip install --upgrade "torchserve==0.12.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.8.2
This is the first release that contains the fix.
pip install --upgrade "torchserve==0.8.2"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Conclusion
The TorchServe Pre-Auth Remote Code Execution vulnerability in torchserve exposes users to the risk of remote code execution due to unsafe deserialization of Java objects. To mitigate this risk, it is crucial to update to TorchServe release 0.8.2, which includes the necessary fixes. Failure to address this vulnerability could result in unauthorized access, data breaches, and compromise of the target system. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for torchserve →
FAQ
TorchServe is an open source library used for serving PyTorch models in production. It provides a lightweight, flexible, and easy-to-use model serving environment.
Versions 0.3.0 to 0.8.1 of TorchServe are affected by this vulnerability.
This vulnerability exposes users to unsafe deserialization of Java objects, allowing potential remote code execution by attackers.
To fix this vulnerability, update to TorchServe release 0.8.2, which includes the necessary fixes.
No specific workarounds have been mentioned for this vulnerability. It is recommended to update to the patched version.
References
Related vulnerabilities
Recent vulnerabilities recorded for torchserve.