CVE-2025-68146
filelock has TOCTOU race condition that allows symlink attacks during lock file creation
Reported by github_m · Published December 16, 2025
filelock is fixed in 3.20.1 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| filelock | PyPI | 3.20.1 |
| awx | Chainguard | 24.6.1-r21 |
| kserve-huggingfaceserver-cuda-13.3 | Chainguard | 0.21.0-r4 |
| mlflow | Chainguard | 3.8.0-r0 |
| mlflow | Wolfi | 3.8.0-r0 |
| airflow-3 | Wolfi | 3.1.5-r0 |
| airflow-3 | Chainguard | 3.1.5-r0 |
| py3-cassandra-medusa | Chainguard | 0.26.0-r2 |
| tritonserver-backend-vllm-cuda-12.9 | Chainguard | 25.9.0_git20251112-r3 |
| python3.13-filelock | Amazon Linux | 3.18.0-1.amzn2023.0.1 |
| text-generation-inference | Chainguard | 3.3.7-r0 |
| airflow-2 | Chainguard | 2.11.0-r17 |
3 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| tox-dev | filelock | < 3.20.1 |
| chainguard | awx | 0 |
| chainguard | kserve-huggingfaceserver-cuda-13.3 | 0 |
| chainguard | mlflow | 0 |
| wolfi | mlflow | 0 |
| wolfi | airflow-3 | 0 |
| chainguard | airflow-3 | 0 |
| chainguard | py3-cassandra-medusa | 0 |
| chainguard | tritonserver-backend-vllm-cuda-12.9 | 0 |
| amazon:2023 | python3.13-filelock | 0 |
| chainguard | text-generation-inference | 0 |
| chainguard | airflow-2 | 0 |
| wolfi | open-webui | 0 |
| tox-dev | filelock | |
| amazon:2023 | python3-filelock | 0 |
| tox-dev | filelock | 0 |
| chainguard | request-1276 | 0 |
| chainguard | kserve | 0 |
| chainguard | open-webui | 0 |
…and 4 more
Timeline
- Dec 16, 2025 CVE Published
- Dec 17, 2025 EPSS Score (30 in total, the first dated here)
- Mar 17, 2026 Security Advisory
- Mar 26, 2026 Coalition ESS Score (2 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-68146
vulnetix vdb fixes CVE-2025-68146
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-68146/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/tox-dev/filelock/security/advisories/GHSA-w853-jp5j-5j7f x_refsource_CONFIRM
- https://github.com/tox-dev/filelock/pull/461 x_refsource_MISC
- https://github.com/tox-dev/filelock/commit/4724d7f8c3393ec1f048c93933e6e3e6ec321f0e x_refsource_MISC
- https://github.com/tox-dev/filelock/releases/tag/3.20.1 x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2025-68146 advisory
- https://github.com/advisories/GHSA-w853-jp5j-5j7f advisory
- https://github.com/tox-dev/filelock url
- https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants url
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html url