CVE-2025-68146
MediumCVSS 6.3Exploitation Probability (EPSS)
Low risk11th percentile - higher than 11% of all known CVEs
Summary
filelock versions prior to 3.20.1 contain a Time-of-Check-Time-of-Use (TOCTOU) race condition in lock file creation. A local attacker can exploit symlink attacks to corrupt or truncate arbitrary user files because the library checks for file existence before opening with O_TRUNC.
Risk Assessment
The vulnerability affects all Unix, Linux, macOS, and Windows systems and can lead to data loss or corruption. Due to cascading to dependent libraries, the risk spans a wide range of applications.
Recommendation
Upgrade filelock to version 3.20.1 or later. If immediate upgrade is not possible, consider using SoftFileLock instead of UnixFileLock/WindowsFileLock and restrict permissions on lock file directories (chmod 0700).
Other vulnerabilities in filelock
See all- CVE-2026-144405Low
filelock versions 3.13.2 through 4.2.12 on Unix lock an existing file that may be owned by another local account in a sticky directory such as /tmp. That account can remove the file while the lock is held, allowing two processes to hold the same exclusive lock. The issue is fixed in version 4.2.12.
- CVE-2026-144404Low
filelock before 4.3.0 on Windows allows a process with read access to strict-lock claims to cause StrictSoftFileLock.release() to fail. A published claim can continue blocking later acquisitions after the reader closes its handle. The issue is fixed in version 4.3.0.
- CVE-2026-144403Low
filelock before 4.3.0 on POSIX allows a StrictSoftFileLock holder and a soft-lock client using the same path to both enter their critical sections if another account owns the sentinel in a shared sticky directory. This compromises mutual exclusion during mixed-client migration. The issue is fixed in version 4.3.0.
- CVE-2026-144395Medium
filelock before 4.3.0 on POSIX allows another account with rename access in a shared non-sticky lock directory to redirect a SQLite-backed ReadWriteLock operation to a file writable by the locking process. A cross-account overwrite was confirmed on Linux. The issue is fixed in version 4.3.0.
- CVE-2026-144394Low
filelock before 4.3.0 on Linux allows two processes to both hold a SoftReadWriteLock write lock after its protocol directory is removed while a lock instance remains alive. This requires another account able to replace directories in the shared location and filesystem reuse of a previously trusted inode number. The issue is fixed in version 4.3.0.
- CVE-2026-144393Low
filelock before 4.3.0 on POSIX allows SoftReadWriteLock to accept a protocol directory whose owner it trusts but whose permissions allow another account to write. In a shared sticky lock location, an account controlling such a directory can cause two processes to hold write locks concurrently without a compromise notification. The issue is fixed in version 4.3.0.
- CVE-2026-144392Low
filelock before 4.3.0 on Windows allows a local account with read access to an idle StrictSoftFileLock sentinel to delay acquisition beyond the requested timeout. A Windows opportunistic lock (oplock) on the sentinel can keep the caller's thread waiting inside the operating system, including during a nonblocking acquisition. The issue is fixed in version 4.3.0.
- CVE-2026-144391Low
In filelock before version 4.3.0 on POSIX, a new StrictSoftFileLock sentinel can inherit group or other write permission. An account with that access can modify the sentinel so that a SoftFileLock client enters the protected section while the strict lock remains held. This affects applications sharing a path between strict and legacy soft locks.
- CVE-2026-144389Low
In filelock before version 4.3.0 on Windows, a local account with read access to a stale soft-lock marker can delay recovery beyond the caller's acquisition timeout. This affects SoftFileLock, MarkerSoftFileLock and SoftFileLease when another process holds a read-handle opportunistic lock on the stale marker. The delay is caused by a Windows opportunistic lock (oplock).
- CVE-2026-144388Low
In filelock for Python prior to 4.3.0, on Unix, temporary-directory exhaustion during filelock import can disable a safeguard in StrictSoftFileLock publication. A local account with rename access to entries in a shared, non-sticky lock directory can gain read access to a file on the same filesystem.
Original NVD description (English source)
filelock is a platform-independent file lock for Python. In versions prior to 3.20.1, a Time-of-Check-Time-of-Use (TOCTOU) race condition allows local attackers to corrupt or truncate arbitrary user files through symlink attacks. The vulnerability exists in both Unix and Windows lock file creation where filelock checks if a file exists before opening it with O_TRUNC. An attacker can create a symlink pointing to a victim file in the time gap between the check and open, causing os.open() to follow the symlink and truncate the target file. All users of filelock on Unix, Linux, macOS, and Windows systems are impacted. The vulnerability cascades to dependent libraries. The attack requires local filesystem access and ability to create symlinks (standard user permissions on Unix; Developer Mode on Windows 10+). Exploitation succeeds within 1-3 attempts when lock file paths are predictable. The issue is fixed in version 3.20.1. If immediate upgrade is not possible, use SoftFileLock instead of UnixFileLock/WindowsFileLock (note: different locking semantics, may not be suitable for all use cases); ensure lock file directories have restrictive permissions (chmod 0700) to prevent untrusted users from creating symlinks; and/or monitor lock file directories for suspicious symlinks before running trusted applications. These workarounds provide only partial mitigation. The race condition remains exploitable. Upgrading to version 3.20.1 is strongly recommended.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

