{"cve":"CVE-2025-68146","nvd":{"published":"2025-12-16T19:15:59.957","modified":"2026-06-17T09:58:38.020","status":"Analyzed","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H","score":6.5},"cwes":["CWE-367","CWE-59","CWE-362"],"references":["https://github.com/tox-dev/filelock/commit/4724d7f8c3393ec1f048c93933e6e3e6ec321f0e","https://github.com/tox-dev/filelock/pull/461","https://github.com/tox-dev/filelock/releases/tag/3.20.1","https://github.com/tox-dev/filelock/security/advisories/GHSA-w853-jp5j-5j7f"],"products":["tox-dev:filelock"],"source":"nvd","synced_at":"2026-10-19T22:17:07.138532058+00:00"},"epss":{"cve":"CVE-2025-68146","score":0.00198,"percentile":0.09546,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-w853-jp5j-5j7f","url":"https://osv.dev/vulnerability/GHSA-w853-jp5j-5j7f","summary":"filelock has a TOCTOU race condition which allows symlink attacks during lock file creation","modified":"2026-09-10T03:50:32.252960082Z","packages":[{"ecosystem":"PyPI","name":"filelock","purl":"pkg:pypi/filelock","ranges":["<3.20.1"],"fixed":["3.20.1"]}]},{"id":"PYSEC-2026-1375","url":"https://osv.dev/vulnerability/PYSEC-2026-1375","summary":"filelock has a TOCTOU race condition which allows symlink attacks during lock file creation","modified":"2026-07-07T17:47:15.042627092Z","packages":[{"ecosystem":"PyPI","name":"filelock","purl":"pkg:pypi/filelock","ranges":["<3.20.1"],"fixed":["3.20.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}