Skip to main content
VulnerabilityPublished Updated

CVE-2026-22701: Pytorch · filelock Time-of-Check-Time-of-Use (TOCTOU) Symlink Vulnerability in SoftFileLock

Affects pytorchSource GCVE Database

0
Compare
Authoritative record:CVE-2026-22701· Medium 5.3

Not known to be exploited · CVSS 5.3 Medium : upgrade to 2.10.0 or 2.1.2 when convenient.

Data as of 31 Oct 2026, 16:05 UTC

CVSS 3.1 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.10.0, 2.1.2
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 10 Jan 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade pytorch to 2.10.0 or 2.1.2.

Affected software

ProductAffectedFixed in
Homebrewpytorchpkg:brew/pytorchOther threatsAffected
  • >=2.0.0 <2.1.2
  • >=2.2.0 <2.10.0
Fixed in
  • 2.1.2
  • 2.10.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available and users should upgrade to filelock versions 2.1.2 or later and 2.10.0 or later where the vulnerability is fixed by adding the O_NOFOLLOW flag. For environments where immediate upgrade is not possible, users should avoid using SoftFileLock in security-sensitive contexts and prefer UnixFileLock or WindowsFileLock. Additionally, restrict filesystem permissions on lock directories to prevent untrusted users from creating symlinks (e.g., chmod 700), isolate untrusted processes from lock file paths, and implement application-level checks to verify successful lock acquisition before proceeding.

Description

A Time-of-Check-Time-of-Use (TOCTOU) race condition vulnerability exists in the SoftFileLock implementation of the filelock package used by PyTorch. The flaw allows an attacker with local filesystem access and permission to create symlinks to exploit a race window between permission checking and file creation, potentially causing lock operations to fail or operate on unintended files. This can lead to silent lock acquisition failures, denial of service, and resource serialization issues. The vulnerability has been patched by adding the O_NOFOLLOW flag to prevent symlink following during lock file creation. Users should upgrade to the patched versions or apply recommended mitigations if immediate upgrade is not possible.

References

Community reviews

Loading reviews…