CVE-2024-35198
TorchServe vulnerability analysis and mitigation

Overview

TorchServe, a flexible tool for serving and scaling PyTorch models in production, was found to contain a security vulnerability (CVE-2024-35198) affecting versions 0.3.0 to 0.10.0. The vulnerability was discovered in the allowed_urls configuration check mechanism, which could be bypassed using specific URL characters. The issue was disclosed and patched in July 2024, with customers using PyTorch inference Deep Learning Containers (DLC) through Amazon SageMaker and EKS remaining unaffected (GitHub Advisory, AWS Bulletin).

Technical details

The vulnerability stems from TorchServe's allowedurls configuration check mechanism, which failed to properly validate URLs containing characters such as ".." during model registration API calls. While the system would display an error message stating "Relative path is not allowed in url", it would still proceed to download the model into the model store. Once downloaded, the model could be referenced without providing a URL in subsequent requests, effectively bypassing the allowedurls security check. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 (Critical) with a vector string of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, indicating high severity across confidentiality, integrity, and availability impacts (GitHub Advisory).

Impact

The vulnerability allows attackers to bypass security controls designed to restrict model loading from authorized URLs. This bypass could potentially lead to unauthorized model deployment and execution, compromising the security of the model serving infrastructure. The high CVSS score of 9.8 indicates critical severity with potential for significant impact on system security (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in TorchServe version 0.11.0 by implementing proper URL validation before downloading models. The fix specifically validates URLs to prevent the use of characters such as ".." that could lead to security bypasses. Users are strongly advised to upgrade to TorchServe version 0.11.0 or later. No workarounds are available for this vulnerability, making the upgrade the only effective mitigation (GitHub Release, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related TorchServe vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4mqg-h5jf-j9m7CRITICAL9.9
  • TorchServeTorchServe
  • torchserve
NoYesOct 02, 2023
CVE-2024-35198CRITICAL9.8
  • TorchServeTorchServe
  • torchserve
NoYesJul 19, 2024
CVE-2024-35199HIGH8.2
  • TorchServeTorchServe
  • torchserve
NoYesJul 19, 2024
CVE-2024-6577MEDIUM6.3
  • TorchServeTorchServe
  • torchserve
NoNoMar 20, 2025
CVE-2023-48299MEDIUM5.3
  • TorchServeTorchServe
  • torchserve
NoYesNov 21, 2023

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management