CVE-2025-68146

filelock has TOCTOU race condition that allows symlink attacks during lock file creation

CVE-2025-68146 is fixed in 4 products on 1 platform, first by DEBIAN-CVE-2025-68146, released December 16, 2025. It is not reported as exploited. Patch Radar priority: Routine.

Routine
CVSS
6.5
Moderate
Exploitation
None reported
No vendor assessment
CISA KEV
Not listed
Not in the Known Exploited Vulnerabilities catalog
EPSS
0.0020
9th percentile

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.

Where it's fixed

ProductFixed inFixReleased
Linux
python-filelock · Debian 12.15 (bookworm) 3.9.0-1+deb12u1 DEBIAN-CVE-2025-68146 Dec 16, 2025
python-filelock · Debian 13.5 (trixie) 3.18.0-1+deb13u1 DEBIAN-CVE-2025-68146 Dec 16, 2025
python-filelock · Debian 14 3.20.2-1 DEBIAN-CVE-2025-68146 Dec 16, 2025
python-filelock · Ubuntu 18.04.6 LTS (bionic) 3.0.4-1ubuntu0.1~esm1 python-filelock 3.0.4-1ubuntu0.1~esm1 Jan 9, 2026
python-filelock · opensuse-leap 15.6 3.12.2-150400.10.8.1 SUSE-SU-2026:0220-1 Jan 22, 2026
python-filelock · opensuse-leap 16.0 3.18.0-160000.3.1 OPENSUSE-SU-2026:20144-1 Jan 30, 2026
python-filelock · sles 15.7 3.12.2-150400.10.8.1 SUSE-SU-2026:0220-1 Jan 22, 2026
python-filelock · sles 16.0 3.18.0-160000.3.1 SUSE-SU-2026:20216-1 Jan 30, 2026
python-filelock-doc · amzn 2023 3.3.1-1.amzn2023.0.2 ALAS2023-2026-1415 Feb 5, 2026
python3-filelock · Ubuntu 18.04.6 LTS (bionic) 3.0.4-1ubuntu0.1~esm1 python3-filelock 3.0.4-1ubuntu0.1~esm1 Jan 9, 2026
python3-filelock · Ubuntu 22.04.1 LTS (jammy) 3.6.0-1ubuntu0.1~esm1 python3-filelock 3.6.0-1ubuntu0.1~esm1 Jan 9, 2026
python3-filelock · Ubuntu 24.04.5 LTS (noble) 3.13.1-1ubuntu0.1~esm1 python3-filelock 3.13.1-1ubuntu0.1~esm1 Jan 9, 2026
python3-filelock · amzn 2023 3.3.1-1.amzn2023.0.2 ALAS2023-2026-1415 Feb 5, 2026
python3.13-filelock · amzn 2023 3.18.0-1.amzn2023.0.1 ALAS2023-2026-1411 Feb 16, 2026

Patch Radar data is free to use with attribution. Terms and how to credit it.

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.