CVE-2025-68146: filelock has TOCTOU race condition that allows symlink attacks during lock file creation
Vulnerability summary
CVE-2025-68146 is a medium (CVSS 6.5) vulnerability in tox-dev filelock. EPSS estimates a 0.20% chance of exploitation in the next 30 days, higher than 10.9% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 6.3, local access); no exploitation reported by the 5 checked sources
CIRCL last checked 05-12-2026
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 5 · Related 11Timeline
- 16-12-2025PublishedVulnerability first disclosed.
- 17-12-2025Last modifiedVulnerability information updated.
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 metrics
7 scores · 7 sources · 1 version- CVE.orgCNA6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
- OSV · PypiEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
- OSV · DebianEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
- OSV · WolfiEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
- OSV · ChainguardEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
EPSS trend
Probability
0.20%
Chance of exploitation in the next 30 days
Percentile
11%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 0.20% on 05-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundFilelock
Maturity: poc
Weaknesses
CWE · root cause- CWE-59Improper Link Resolution Before File AccessThe product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
- CWE-362Concurrent Execution using Shared Resource with Improper SynchronizationThe product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.
- CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionThe product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
Affected systems
Known conditions: local access, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard36 products
- airflow-2< 2.11.0-r17
- airflow-2-bitnami-compat< 2.11.0-r17
- airflow-2-compat< 2.11.0-r17
- airflow-2-iamguarded-compat< 2.11.0-r17
- airflow-3< 3.1.5-r0
Wolfi21 products
- airflow-3< 3.1.5-r0
- airflow-3-bitnami-compat< 3.1.5-r0
- airflow-3-compat< 3.1.5-r0
- airflow-3-iamguarded-compat< 3.1.5-r0
- datadog-agent-7.72-core-integrationsAll versions (No fix recorded)
Opensuse2 products
- ansible-lint&distro=openSUSE Tumbleweed< 26.11.0-2.1
- python-filelock&distro=openSUSE Tumbleweed< 3.20.2-1.1
Suse2 products
- python-filelock&distro=SUSE Linux Enterprise Module for Development Tools 15 SP7< 3.0.12-150100.3.6.1
- python-filelock&distro=SUSE Linux Enterprise Module for Package Hub 15 SP7< 3.0.12-150100.3.6.1
Debian1 product
- python-filelock< 3.9.0-1+deb12u1 | < 3.18.0-1+deb13u1 | < 3.20.2-1
PyPI1 product
- filelock< 3.20.1
Tox-dev1 product
- filelock< 3.20.1
Ubuntu1 product
- python-filelockAll versions (No fix recorded) | < 3.0.4-1ubuntu0.1~esm1 | < 3.6.0-1ubuntu0.1~esm1 | < 3.13.1-1ubuntu0.1~esm1
8 vendors · 65 products
References
18 links- github.com/tox-dev/filelock/security/advisories/GHSA-w853-jp5j-5j7fX Refsource CONFIRMWEBREPORTAdvisoryExploitMitigationVendor Advisory
- github.com/tox-dev/filelock/commit/4724d7f8c3393ec1f048c93933e6e3e6ec321f0eX Refsource MISCWEBREPORTFIXPatch
- github.com/tox-dev/filelockPACKAGE
Show all 18 references
- pypi.org/project/filelockPACKAGE