CVE-2023-48299: TorchServe ZipSlip
Summary
CVE-2023-48299: TorchServe ZipSlip. Affects torchserve versions >= 0.1.0, < 0.9.0. Fixed in 0.9.0. 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 models. It provides an API for managing models and workflows. TorchServe allows users to upload and serve models, but it was found to be vulnerable to a ZipSlip issue. This vulnerability could allow malicious actors to upload harmful archives containing files that are extracted to any location on the filesystem within the process permissions. This could enable the hiding of harmful code in open-source/public models, which can be downloaded and executed on machines running TorchServe.
Vulnerability Detail
The ZipSlip vulnerability in TorchServe allows for the extraction of files from potentially harmful archives to arbitrary locations on the filesystem. This can be exploited by uploading malicious archives that contain files with malicious code. The extracted files can then be executed within the process permissions, potentially leading to unauthorized access, data leakage, or remote code execution. This vulnerability poses a moderate risk to systems running TorchServe.
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.9.0
This is the first release that contains the fix.
pip install --upgrade "torchserve==0.9.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Conclusion
The TorchServe ZipSlip vulnerability allows for the extraction of files from potentially harmful archives to arbitrary locations on the filesystem. This can be exploited by uploading malicious archives that contain files with malicious code. To mitigate this vulnerability, it is recommended to update to TorchServe version 0.9.0 or later. 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 models. It provides an API for managing models and workflows.
ZipSlip is a vulnerability that occurs when an application does not properly validate the paths of files contained within a zip archive before extracting them. This can lead to the extraction of files to arbitrary locations on the filesystem, potentially allowing for the execution of malicious code.
The TorchServe ZipSlip vulnerability allows for the extraction of files from potentially harmful archives to arbitrary locations on the filesystem. This can be exploited by uploading malicious archives that contain files with malicious code. The extracted files can then be executed within the process permissions, potentially leading to unauthorized access, data leakage, or remote code execution.
The TorchServe ZipSlip vulnerability has been fixed in version 0.9.0. It is recommended to update to this version or later to mitigate the vulnerability. Users can update TorchServe by following the instructions provided in the release notes on the GitHub repository.
There is no known workaround for the TorchServe ZipSlip vulnerability. It is recommended to update to version 0.9.0 or later to address the vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for torchserve.