AgentbeamBeta
AI agent vulnerability · TorchServe

CVE-2024-35199: TorchServe gRPC Port Exposure

highCVSS 4.0 8.8 · 3.1 8.2GHSA-hhpg-v63p-wp7w

TorchServe from 0.3.0 up to 0.11.0 binds its two gRPC ports, 7070 and 7071, to all network interfaces by default instead of localhost. Anyone who can reach the host can connect to them. Upgrade torchserve to 0.11.0. Amazon SageMaker and EKS inference Deep Learning Containers are not affected.

Published Jul 18, 2024 · Updated Aug 7, 2024 · Analysis Nov 10, 2026

What an attacker can do

TorchServe's gRPC inference port (7070) and management port (7071) listen on every interface when the server starts (CWE-668). A host that is meant to be reachable only locally, or only through a gateway, therefore answers gRPC clients from the wider network.

The attacker needs only network access to the host, with no login and no user interaction. The CVSS vector rates low confidentiality impact and high availability impact. The advisory does not describe what the services allow. A management port reachable by strangers is the concern, since it can change which models are served, and the inference port lets anyone run predictions and consume compute. Treat any model server exposed this way as open to abuse, especially on cloud hosts with public addresses. Kroll Cyber Risk reported the issue.

Who is affected

torchserve from 0.3.0 up to but not including 0.11.0, when started directly, not through the AWS Deep Learning Containers. Check the version and the listening sockets:

pip show torchserve
ss -ltnp | grep -E ':(7070|7071)'

An address of 0.0.0.0 or [::] on those ports means they are exposed to the network.

torchserve

Ecosystem
PyPI
Affected
>= 0.3.0, < 0.11.0
Fixed in
0.11.0
Check
pip show torchserve

How to fix it

Upgrade to torchserve 0.11.0, which includes the fix from PR 3083:

pip install --upgrade "torchserve>=0.11.0"

The advisory does not say whether the fix changes the default to localhost or adds a setting, and it lists no workaround. After upgrading, run the ss command again and confirm ports 7070 and 7071 no longer listen on all interfaces unless you set them to.

How to tell if you were hit

Look for listeners on 7070 and 7071 bound to 0.0.0.0 or a public address. Review firewall and flow logs for connections to those ports from unexpected sources. Check TorchServe logs for gRPC calls, model registration or scaling requests you did not make.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

The two gRPC ports 7070 and 7071, are not bound to localhost by default, so when TorchServe is launched, these two interfaces are bound to all interfaces. Customers using PyTorch inference Deep Learning Containers (DLC) through Amazon SageMaker and EKS are not affected.

Patches

This issue in TorchServe has been fixed in #3083.

TorchServe release 0.11.0 includes the fix to address this vulnerability.

References

Thank Kroll Cyber Risk for for responsibly disclosing this issue.

If you have any questions or comments about this advisory, we ask that you contact AWS Security via our vulnerability reporting page or directly via email to [[email protected]](mailto:[email protected]). Please do not create a public GitHub issue.

Questions

Are SageMaker and EKS deployments affected?

No. The advisory says customers using the PyTorch inference Deep Learning Containers through Amazon SageMaker and EKS are not affected.

Which version fixes CVE-2024-35199?

torchserve 0.11.0 fixes it. Everything from 0.3.0 up to but not including 0.11.0 is affected.

Which ports are involved?

The two gRPC ports 7070 and 7071, which are bound to all interfaces by default in affected versions.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More TorchServe vulnerabilities

All TorchServe entries