CVE-2023-43654: TorchServe Server-Side Request Forgery vulnerability in torchserve
Summary
CVE-2023-43654: TorchServe Server-Side Request Forgery vulnerability. Affects torchserve versions >= 0.1.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 model serving library for PyTorch, allowing users to deploy and serve PyTorch models in production environments. It provides an easy-to-use API and supports various deployment configurations. However, TorchServe versions 0.1.0 to 0.8.1 are vulnerable to a Server-Side Request Forgery (SSRF) issue.
Vulnerability Detail
The SSRF vulnerability in TorchServe arises from the lack of proper input validation in its default configuration. This allows third parties to invoke remote HTTP download requests and write files to the disk. Exploiting this vulnerability could compromise the integrity of the system and expose sensitive data. The vulnerability has a CVSS score of 9.8, indicating its critical severity.
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 →
Workaround
There is no specific workaround mentioned for this vulnerability. The recommended approach is to upgrade to the patched version of TorchServe.
Conclusion
The TorchServe Server-Side Request Forgery vulnerability in torchserve poses a critical risk to the integrity of systems and sensitive data. It is recommended to upgrade to TorchServe version 0.8.2 or later to address this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for torchserve →
FAQ
TorchServe is an open-source model serving library for PyTorch, designed to simplify the deployment and serving of PyTorch models in production environments.
Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to make requests from the vulnerable server to other internal or external resources, potentially leading to unauthorized access or data leakage.
The vulnerability in TorchServe could be exploited by an attacker to invoke remote HTTP download requests and write files to the disk, compromising the system's integrity and exposing sensitive data.
To mitigate this vulnerability, it is crucial to upgrade to TorchServe version 0.8.2 or later, which includes fixes for the SSRF issue. Additionally, users should configure the 'allowed_urls' and specify the model URL to be used to ensure proper input validation.
This vulnerability was responsibly disclosed by Oligo Security. They worked with the TorchServe project to resolve the issue.
References
Related vulnerabilities
Recent vulnerabilities recorded for torchserve.