CVE-2023-48299: TorchServe ZipSlip Vulnerability
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 framework for PyTorch, designed to facilitate the deployment of machine learning models at scale. It allows users to manage and serve models through a variety of APIs, enabling efficient inference and model management. However, TorchServe is vulnerable to a ZipSlip issue, which can lead to unauthorized file extraction and potential exploitation.
Vulnerability Detail
The ZipSlip vulnerability in TorchServe arises from the improper handling of zip archive files during the model and workflow management process. This flaw allows attackers to upload malicious archives that can extract files to arbitrary locations on the filesystem, provided they are within the process's permissions. This could enable third-party actors to hide harmful code in models that are publicly available, posing a significant 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 →
Workaround
As a temporary measure, avoid uploading zip archives from untrusted sources until the package is updated. Additionally, implement strict validation of file paths before extraction to mitigate risks.
Conclusion
The ZipSlip vulnerability in TorchServe poses a significant risk by allowing unauthorized file extraction from zip archives. Users are strongly advised to update to version 0.9.0 or later to mitigate this risk. Implementing best practices for file validation can also help reduce exposure until the patch is applied.
See every vulnerability recorded for torchserve →
FAQ
The CVSS score for the ZipSlip vulnerability in TorchServe is 5.3, indicating a moderate level of severity.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit the Vulert playground at Vulert Scanner to check if your application is affected without requiring signup.
Exploitation of this vulnerability could allow attackers to execute harmful code on the server, leading to data breaches, unauthorized access, or service disruptions.
Yes, avoid using zip archives from untrusted sources and validate file paths before extraction as a temporary workaround.
Oligo Security is credited for responsibly disclosing the ZipSlip vulnerability in TorchServe.
References
Related vulnerabilities
Recent vulnerabilities recorded for torchserve.