Vulnerability · Published Jan 10, 2026 · Assigned by GitHub_M
CVE-2026-22701filelock Time-of-Check-Time-of-Use (TOCTOU) Symlink Vulnerability in SoftFileLock
Medium 5.3
In plain English
A medium-severity race condition in filelock from tox-dev. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 2% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
filelock is a platform-independent file lock for Python. Prior to version 3.20.3, a TOCTOU race condition vulnerability exists in the SoftFileLock implementation of the filelock package. An attacker with local filesystem access and permission to create symlinks can exploit a race condition between the permission validation and file creation to cause lock operations to fail or behave unexpectedly. The vulnerability occurs in the _acquire() method between raise_on_not_writable_file() (permission check) and os.open() (file creation). During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service. This issue has been patched in version 3.20.3.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | python-filelock | 3.9.0-1+deb12u1 | DEBIAN-CVE-2026-22701 |
| Debian:13 | python-filelock | no fix listed | DEBIAN-CVE-2026-22701 |
| Debian:14 | python-filelock | 3.20.3-1 | DEBIAN-CVE-2026-22701 |
| PyPI | filelock | 3.20.3 | GHSA-qmgc-5h2g-mvrw |
| PyPI | filelock | 3.20.3 | PYSEC-2026-1374 |
| Ubuntu:25.10 | python-filelock | no fix listed | UBUNTU-CVE-2026-22701 |
| Ubuntu:26.04:LTS | python-filelock | no fix listed | UBUNTU-CVE-2026-22701 |
| Ubuntu:26.10 | python-filelock | no fix listed | UBUNTU-CVE-2026-22701 |
Affected products (as reported)
Weakness: CWE-59, CWE-362, CWE-367 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H