CVE-2026-123974 PUBLISHED

pytorch/serve: Local privilege escalation through insecure temporary path

Assigner: Akrites
Reserved: 06.11.2026 Published: 06.11.2026 Updated: 06.11.2026

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.

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8

Product Status

Vendor PyTorch
Product TorchServe
Versions Default: unknown
  • affected from 0 to * (excl.)

Workarounds

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.

Solutions

The project is archived and currently no permanent solution is scheduled for release. See workaround section.

Credits

  • Christ Bowel finder

References

Problem Types

  • CWE-379 Creation of temporary file in directory with insecure permissions CWE