VDB

CVE-2025-68146

CVE-2025-68146 PUBLISHED CVSS 6.3 MEDIUM

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.

PackageEcosystemFixed in
filelockPyPI3.20.1
awxChainguard24.6.1-r21
kserve-huggingfaceserver-cuda-13.3Chainguard0.21.0-r4
mlflowChainguard3.8.0-r0
mlflowWolfi3.8.0-r0
airflow-3Wolfi3.1.5-r0
airflow-3Chainguard3.1.5-r0
py3-cassandra-medusaChainguard0.26.0-r2
tritonserver-backend-vllm-cuda-12.9Chainguard25.9.0_git20251112-r3
python3.13-filelockAmazon Linux3.18.0-1.amzn2023.0.1
text-generation-inferenceChainguard3.3.7-r0
airflow-2Chainguard2.11.0-r17

3 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
6.3
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H

Affected products

VendorProductVersions
tox-devfilelock< 3.20.1
chainguardawx0
chainguardkserve-huggingfaceserver-cuda-13.30
chainguardmlflow0
wolfimlflow0
wolfiairflow-30
chainguardairflow-30
chainguardpy3-cassandra-medusa0
chainguardtritonserver-backend-vllm-cuda-12.90
amazon:2023python3.13-filelock0
chainguardtext-generation-inference0
chainguardairflow-20
wolfiopen-webui0
tox-devfilelock
amazon:2023python3-filelock0
tox-devfilelock0
chainguardrequest-12760
chainguardkserve0
chainguardopen-webui0

…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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›