CVE-2024-35198 TorchServe bypass allowed_urls configuration
Attackers can bypass URL restrictions in TorchServe to download arbitrary models, undermining security controls for model serving.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-35198?
CVE-2024-35198 is a critical vulnerability in pytorch serve, published on 18 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. TorchServe 's check on allowed_urls configuration can be by-passed if the URL contains characters such as ".." but it does not prevent the model from being downloaded into the model store. Once a file is downloaded, it can be referenced without providing a URL the second time, which effectively bypasses the allowed_urls security check. Customers using PyTorch inference Deep Learning Containers (DLC) through Amazon SageMaker and EKS are not affected. This issue in TorchServe has been fixed by validating the URL without characters such as ".." before downloading see PR #3082. TorchServe release 0.11.0 includes the fix to address this vulnerability. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-706
Which versions are affected by CVE-2024-35198?
3 open source packages ship an affected version, including torchserve. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
torchserve PyPI | All versions | 0.11.0 |
torchserve PyPI | All versions | 0.11.0 |
torchserve PyPI | All versions | 0.11.0 |
Products include Pytorch Torchserve.
How do I fix CVE-2024-35198?
Upgrade torchserve to 0.11.0 or later.
Is CVE-2024-35198 being exploited?
There is no known exploitation of CVE-2024-35198 in the wild and no public exploit code.
Other vulnerabilities in pytorch serve
Sources
Also known as GHSA-wxcx-gg9c-fwp2, PYSEC-2026-554.