Skip to main content
VulnerabilityPublished Updated

CVE-2025-68146: Poetry · filelock has a TOCTOU race condition which allows symlink attacks during lock file creation

Affects poetrySource GCVE Database

0
Compare
Authoritative record:CVE-2025-68146· Medium 6.3

Not known to be exploited · CVSS 6.3 Medium : upgrade to 2.2.1_2 or 1.6.1_1 when convenient.

Data as of 30 Oct 2026, 08:30 UTC

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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 16 Dec 2025

  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 29 Oct 2026.

What to do

Upgrade poetry to 2.2.1_2 or 1.6.1_1.

Affected software

ProductAffectedFixed in
Homebrewpoetrypkg:brew/poetryOther threatsAffected
  • >=1.1.0 <1.6.1_1
  • >=1.8.0 <2.2.1_2
Fixed in
  • 1.6.1_1
  • 2.2.1_2

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

AI-suggested

A fix is available in filelock version 3.20.1 and later (corresponding to poetry fixed versions 1.6.1_1 and 2.2.1_2). Users should upgrade immediately to these versions or later. If upgrading is not immediately possible, partial mitigations include using SoftFileLock instead of UnixFileLock/WindowsFileLock, restricting lock file directory permissions to prevent untrusted symlink creation, and monitoring lock directories for suspicious symlinks. However, these workarounds do not fully eliminate the race condition and upgrading remains strongly recommended.

Description

CVE-2025-68146 is a Time-of-Check-Time-of-Use (TOCTOU) race condition in the filelock library used by poetry and other tools. It allows local attackers with filesystem access to exploit a race window during lock file creation to replace the lock file with a symlink to an arbitrary file, causing that file to be truncated. This affects Unix, Linux, macOS, and Windows systems. The vulnerability can corrupt or truncate user files, impacting dependent tools like virtualenv, PyTorch, poetry, and tox. The issue is fixed in filelock version 3.20.1 by preventing symlink following during file open operations.

References

Community reviews

Loading reviews…