Skip to main content
VulnerabilityPublished Updated

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

Affects poetrySource GCVE Database

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

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

Data as of 30 Oct 2026, 08:17 UTC

CVSS 3.1 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.2.1_3, 1.6.1_1
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 29 Oct 2026.

What to do

Upgrade poetry to 2.2.1_3 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_3
Fixed in
  • 1.6.1_1
  • 2.2.1_3

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 in versions 1.6.1_1 and 2.2.1_3 and later that adds the O_NOFOLLOW flag to prevent symlink attacks during lock file creation. Users should upgrade to these patched versions when possible. For critical deployments, it is recommended to use UnixFileLock or WindowsFileLock instead of SoftFileLock, as these have been patched previously. If immediate upgrade is not possible, restrict filesystem permissions on lock directories to prevent untrusted users from creating symlinks (e.g., chmod 700 on lock directories), avoid using SoftFileLock in security-sensitive contexts, isolate untrusted code from lock file paths, and implement application-level verification of lock acquisition success.

Description

CVE-2026-22701 is a Time-of-Check-Time-of-Use (TOCTOU) race condition vulnerability in the SoftFileLock class of the filelock package used by Poetry. It allows a local attacker with permission to create symlinks to exploit a race window between permission checking and file creation, potentially causing lock acquisition to fail silently, leading to denial of service or unintended file operations. The issue affects applications using SoftFileLock or fallback FileLock on systems without fcntl support. A patch adding the O_NOFOLLOW flag to prevent symlink following during lock file creation is available in versions 1.6.1_1 and 2.2.1_3 and later. Users are advised to upgrade or apply mitigations such as restricting filesystem permissions or using alternative locking mechanisms.

References

Community reviews

Loading reviews…