Description
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.
Published: 2026-11-06
Score: 7.8 High
EPSS: n/a
KEV: No
Impact: Local Privilege Escalation
Action: Apply Workaround
AI Analysis

Impact

The vulnerability resides in TorchServe, where the temporary extraction directory is predictable and located in /tmp. A local user can replace the model handler by creating files in that location, causing TorchServe to load malicious code under its service account. This results in local privilege escalation, allowing the attacker to execute code with the rights of the service account and potentially gain wider system access.

Affected Systems

All PyTorch TorchServe instances are affected, regardless of version, because each installation contains the insecure default temporary path handling. No specific version exclusions are noted.

Risk and Exploitability

The CVSS score of 7.8 indicates significant severity. While EPSS data is not available, the admission that the exploit requires local access suggests that an attacker must have local user privileges or the ability to write to /tmp. The flaw is not yet listed in CISA KEV, yet the combination of a predictable path and the lack of ownership checks makes it a straightforward local privilege escalation vector for users who can manipulate files in /tmp or influence the extraction process.

Generated by OpenCVE AI on November 6, 2026 at 21:40 UTC.

Remediation

Vendor Solution

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


Vendor 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.


OpenCVE Recommended Actions

  • Set the environment variable TEMP or use the Java option -Djava.io.tmpdir to point to a directory owned by the TorchServe service account that is not world-writable.
  • Configure the TorchServe systemd unit with PrivateTmp=yes so that /tmp is namespace‑isolated for the service.
  • Adjust the TorchServe code or deployment to extract into a directory owned by the service account and reject any pre‑existing extraction root not owned by that account, preventing reuse of arbitrary directories.

Generated by OpenCVE AI on November 6, 2026 at 21:40 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 06 Nov 2026 20:00:00 +0000

Type Values Removed Values Added
Description 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.
Title pytorch/serve: Local privilege escalation through insecure temporary path
Weaknesses CWE-379
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: Akrites

Published:

Updated: 2026-11-06T20:18:25.863Z

Reserved: 2026-11-06T17:53:03.966Z

Link: CVE-2026-123974

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-06T20:17:20.633

Modified: 2026-11-06T21:17:08.410

Link: CVE-2026-123974

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-06T21:45:10Z

Weaknesses
  • CWE-379

    Creation of Temporary File in Directory with Insecure Permissions