PyTorch TorchServe
pytorch/serve: Local privilege escalation through insecure temporary path
In all versions of PyTorch's TorchServe, a predictable extraction directory in /tmp lets a local user swap the model handler and run code as the TorchServe service account leading to local privilege escalation.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < *
Fixed in *
Mitigation
The project is archived and currently no permanent solution is scheduled for release. See workaround section.
Workaround
Three independent fixes: * Set TEMP (or pass -Djava.io.tmpdir) to a directory the service account owns and that is not world-writable. * Harden the systemd unit with PrivateTmp=yes, so /tmp is namespaced per service. * At the code level, extract into a directory owned by the service account and refuse to reuse a pre-existing extraction root that the service does not own, instead of forceMkdir-ing into whatever is already there.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.