Arbitrary file truncation via lock-path symlink race
Published Dec 16, 2025 · Updated Dec 16, 2025
TOCTOU race in tox-dev filelock before 3.20.1 allows local users to truncate arbitrary files through crafted lock-path symlinks. UnixFileLock checks existence before os.open uses O_TRUNC, while WindowsFileLock opens after a non-atomic writability check; both follow a substituted link. Exploitation requires local filesystem access, a predictable lock path, and symlink creation rights, allowing files writable by the victim process to be reduced to zero bytes.
Summary
What happened
TOCTOU race in tox-dev filelock before 3.20.1 allows local users to truncate arbitrary files through crafted lock-path symlinks. UnixFileLock checks existence before os.open uses O_TRUNC, while WindowsFileLock opens after a non-atomic writability check; both follow a substituted link. Exploitation requires local filesystem access, a predictable lock path, and symlink creation rights, allowing files writable by the victim process to be reduced to zero bytes.
The record
- CVE
- CVE-2025-68146
- Published
- Dec 16, 2025
- Updated
- Dec 16, 2025
- Vendor
- tox-dev
- Product
- filelock
- Classifications
- CWE-59, CWE-362, CWE-367, T1485
- Attack vector
- local
- Privileges
- Unavailable
Timeline
How it unfolded
- Dec 16, 2025CVE publishedPublication date reported by the CVE source.
- Dec 16, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 3.20.1
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- filelock_simple_poc.pyproof of concept · demonstrated
- weaponized_pytorch.pyfunctional · demonstrated
- weaponized_virtualenv.pyfunctional · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo