CVE & CISA-KEV Catalog

CVE-2025-68146

MEDIUM
6.3
CVSS v3
NVD

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.

How to fix

Remediation Available
python-filelockDebian
Fixed in:3.18.0-1+deb13u1CVE-2025-68146
Fixed in:3.20.2-1CVE-2025-68146
python-filelockUbuntu
Fixed in:3.0.4-1ubuntu0.1~esm1USN-7999-1
Fixed in:3.0.12-2ubuntu0.1~esm1USN-7999-1
Fixed in:3.6.0-1ubuntu0.1~esm1USN-7999-1
Fixed in:3.13.1-1ubuntu0.1~esm1USN-7999-1
python3-filelockUbuntu
Fixed in:3.0.4-1ubuntu0.1~esm1USN-7999-1
Fixed in:3.0.12-2ubuntu0.1~esm1USN-7999-1
Fixed in:3.6.0-1ubuntu0.1~esm1USN-7999-1
Fixed in:3.13.1-1ubuntu0.1~esm1USN-7999-1

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorLocal
Attack ComplexityHigh
Privileges RequiredLow
User InteractionNone
ScopeUnchanged

Impact

ConfidentialityNone
IntegrityHigh
AvailabilityHigh

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

Exploit Intelligence

0.18%probability of exploitation in 30 days
8thpercentile

Low risk: more likely to be exploited than 8% of all known CVEs.

References

Exploit1
Release Notes1

Related Vulnerabilities

Other CWE-59 (Link Following) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2022-30333High7.599%KEV + RansomFix
CVE-2021-21300High8.089%-Fix
CVE-2021-32610High7.173%-Fix
CVE-2020-36193High7.571%KEVFix
CVE-2023-40028Medium4.958%-Fix
CVE-2020-0787High7.843%KEV + Ransom-
Embed a live status badge for CVE-2025-68146
CVE-2025-68146 severity badge

Markdown

[![CVE-2025-68146](https://tridentstack.com/cve/badge/CVE-2025-68146.svg)](https://tridentstack.com/cve/CVE-2025-68146)

HTML

<a href="https://tridentstack.com/cve/CVE-2025-68146"><img src="https://tridentstack.com/cve/badge/CVE-2025-68146.svg" alt="CVE-2025-68146"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2026-03-05.