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.
TorchServe verifies whether the provided URL belongs to the allowed_urls list, but does not block addresses containing path traversal characters such as "..". An attacker can submit a crafted URL with such characters, allowing the file to be downloaded to the model store while bypassing verification. After the file is downloaded, it can be referenced again without providing the full URL, which effectively circumvents the security mechanism on subsequent requests. The vulnerability is classified as CWE-706, which is improper restriction of rendered UI layers or frames.
An unauthenticated attacker can load any unauthorized model into a production environment, which may lead to data confidentiality breach, system integrity violation, and availability issues — including potentially executing malicious code in the context of the inference server.
TorchServe should be updated to version 0.11.0 or later, which contains a fix that validates URLs for disallowed characters (including "..") before downloading the file (PR #3082). There are no known workarounds — updating is the only recommended remediation measure.
PyTorch TorchServe in all versions prior to 0.11.0. Users using PyTorch inference Deep Learning Containers (DLC) through Amazon SageMaker and EKS are not vulnerable.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HPytorch Torchserve
APPPytorch0.4.2 – 0.11.0 (bez)
Related vulnerabilities
TorchServe is a tool for serving and scaling PyTorch models in production. TorchServe default configuration la...
TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. In affecte...
TorchServe is a tool for serving and scaling PyTorch models in production. Starting in version 0.1.0 and prior...