{"id":"CVE-2026-22701","published":"2026-01-10T05:59:28Z","modified":"2026-01-12T16:45:50Z","title":"filelock Time-of-Check-Time-of-Use (TOCTOU) Symlink Vulnerability in SoftFileLock","vendor":"tox-dev","product":"filelock","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00127,"percentile":0.02389,"provenance":"source"},"cwes":[{"id":"CWE-59","name":"Improper Link Resolution Before File Access"},{"id":"CWE-362","name":"Concurrent Execution using Shared Resource with Improper Synchronization"},{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition"}],"references":[{"url":"https://github.com/tox-dev/filelock/security/advisories/GHSA-qmgc-5h2g-mvrw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tox-dev/filelock/commit/255ed068bc85d1ef406e50a135e1459170dd1bf0","tags":["x_refsource_MISC"]},{"url":"https://github.com/tox-dev/filelock/commit/41b42dd2c72aecf7da83dbda5903b8087dddc4d5","tags":["x_refsource_MISC"]}],"priority":{"score":4.2,"factors":[{"name":"EPSS percentile","points":0.48},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"tox-dev","affectedVersions":[{"vendor":"tox-dev","product":"filelock","versions":["< 3.20.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-01-12T16:45:44.181459Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"filelock","vulnerableRanges":["<3.20.3"],"patched":["3.20.3"],"from":["GHSA-qmgc-5h2g-mvrw","PYSEC-2026-1374"],"provenance":"source"}],"summary":{"text":"The filelock Python package's SoftFileLock implementation contains a time-of-check-time-of-use race condition in its _acquire() method, lying between the permission check and the file creation step. An attacker with local filesystem access who can create symlinks can exploit this window by placing a symlink at the lock file path, causing lock operations to fail, misbehave, or act on an unintended target file.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:21:34Z"},"euvd":{"id":"EUVD-2026-1870","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2025-68146","published":"2025-12-16","fixed":"3.20.1","kev":false,"link":{"from":"CVE-2025-68146","to":"CVE-2026-22701","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:filelock","fromFixed":"3.20.1","toFixed":"3.20.3","daysApart":25},{"kind":"similar","provenance":"machine","score":0.3,"basis":"same product + CWE + description similarity"}]}},{"cve":"CVE-2026-22701","published":"2026-01-10","fixed":"3.20.3","kev":false},{"cve":"CVE-2026-112936","published":"2026-10-20","fixed":"4.0.9","kev":false},{"cve":"CVE-2026-112906","published":"2026-10-20","fixed":"4.2.1","kev":false},{"cve":"CVE-2026-112907","published":"2026-11-05","fixed":"4.2.1","kev":false}],"package":"PyPI:filelock"}}