Description
TorchServe is a tool for serving and scaling PyTorch models in production. TorchServe default configuration lacks proper input validation, enabling third parties to invoke remote HTTP download requests and write files to the disk. This issue could be taken advantage of to compromise the integrity of the system and sensitive data. This issue is present in versions 0.1.0 to 0.8.1. A user is able to load the model of their choice from any URL that they would like to use. The user of TorchServe is responsible for configuring both the allowed_urls and specifying the model URL to be used. A pull request to warn the user when the default value for allowed_urls is used has been merged in PR #2534. TorchServe release 0.8.2 includes this change. Users are advised to upgrade. There are no known workarounds for this issue.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pytorch | serve | >= 0.1.0, < 0.8.2 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
PyTorch Model Server Registration and Deserialization RCE
exploit/multi/http/torchserver_cve_2023_43654
GitHub 2 repositories
-
OligoCyberSecurity/ShellTorchChecker ★ 40 · Oct 2, 2023
A tool that checks if a TorchServe instance is vulnerable to CVE-2023-43654
-
OligoCyberSecurity/CVE-2023-43654 ★ 3 · May 28, 2024
Demo for CVE-2023-43654 - Remote Code Execution in PyTorch TorchServe
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- PyTorch TorchServe SSRF http/cves/2023/CVE-2023-43654.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | torchserve | >= 0.1.0, < 0.8.2 | 0.8.2 | GHSA-8fxr-qfr9-p34w |
Advisories 1
- WID-SEC-2023-2545 PyTorch: Schwachstelle ermöglicht Manipulation von Dateien BSI CERT-Bund (WID) · Oct 3, 2023