cve.bz

CVE-2025-68146 tox-dev filelock: Link Following

6.5 mediumExploit referenceEPSS 0.2%Fix available

Medium (6.5) in tox-dev filelock. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in filelock 3.20.1.

On this page
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.

Severity

CVSS 3.1

6.5 medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 10th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-12-17. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
CWE-59 Improper Link Resolution Before File Access (Link Following)
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition)
OWASP Top 10
A01:2025 Broken Access Control, A06:2025 Insecure Design
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-68146 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-68146?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-68146?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-68146 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
tox-dev:filelockbefore 3.20.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-w853-jp5j-5j7fPyPIfilelock<3.20.13.20.1
PYSEC-2026-1375PyPIfilelock<3.20.13.20.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12python-filelock3.9.0-1+deb12u1DEBIAN-CVE-2025-68146
Debian13python-filelock3.18.0-1+deb13u1DEBIAN-CVE-2025-68146
Debian14python-filelock3.20.2-1DEBIAN-CVE-2025-68146
Ubuntu25.10, 26.10python-filelockno fix listedUBUNTU-CVE-2025-68146
UbuntuPro:18.04:LTSpython-filelock3.0.4-1ubuntu0.1~esm1UBUNTU-CVE-2025-68146 USN-7999-1
UbuntuPro:20.04:LTSpython-filelock3.0.12-2ubuntu0.1~esm1USN-7999-1
UbuntuPro:22.04:LTSpython-filelock3.6.0-1ubuntu0.1~esm1UBUNTU-CVE-2025-68146 USN-7999-1
UbuntuPro:24.04:LTSpython-filelock3.13.1-1ubuntu0.1~esm1UBUNTU-CVE-2025-68146 USN-7999-1
SUSELinux Enterprise Module for Development Tools 15 SP7, Linux Enterprise Module for Package Hub 15 SP7python-filelock3.0.12-150100.3.6.1SUSE-SU-2026:0082-1
SUSELinux Enterprise Module for Python 3 15 SP7python-filelock3.12.2-150400.10.8.1SUSE-SU-2026:0220-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0python-filelock3.18.0-160000.3.1SUSE-SU-2026:20216-1
openSUSELeap 15.6python-filelock3.12.2-150400.10.8.1SUSE-SU-2026:0220-1
openSUSELeap 16.0python-filelock3.18.0-160000.3.1openSUSE-SU-2026:20144-1
openSUSETumbleweedansible-lint26.11.0-2.1openSUSE-SU-2026:12481-1
openSUSETumbleweedpython-filelock3.20.2-1.1openSUSE-SU-2026:10010-1
openSUSETumbleweedpython-virtualenv20.36.1-1.1openSUSE-SU-2026:10055-1
Azure Linux2python-filelockno fix listedAZL-79232
Azure Linux3python-filelock3.20.1-1AZL-72739
Alpaquita23, 25, streampy3-filelockno fix listedBELL-CVE-2025-68146

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This vulnerability is rated Moderate for Red Hat because it is a Time-of-Check-Time-of-Use (TOCTOU) race condition in the `filelock` library that allows a local attacker with low privileges to truncate or corrupt arbitrary user files via symlink attacks. Exploitation requires local filesystem access and the ability to create symlinks, which are standard user permissions on Unix-like systems. The impact is limited to applications utilizing affected versions of `filelock` that create lock files in predictable, attacker-writable locations.

Red Hat's mitigation

Ensure lock file directories used by applications employing filelock have restrictive permissions, such as chmod 0700, to prevent untrusted users from creating symlinks. Additionally, monitor these directories for suspicious symlinks before executing trusted applications. Applying these permission changes may require a service reload or restart.

ProductPackageStateAdvisory
Migration Toolkit for Containersrhmtc/openshift-migration-hook-runner-rhel8Fix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/grafana-rhel8Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/istio-cni-rhel8Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/istio-must-gather-rhel9Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/istio-operator-bundleFix deferred
OpenShift Service Mesh 2openshift-service-mesh/istio-rhel8-operatorFix deferred
OpenShift Service Mesh 2openshift-service-mesh/pilot-rhel8Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/proxyv2-rhel9Fix deferred
OpenShift Service Mesh 2openshift-service-mesh/ratelimit-rhel8Fix deferred
OpenShift Service Mesh 3openshift-service-mesh-dev-preview-beta/istio-ztunnel-rhel9Fix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-cni-rhel9Fix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-must-gather-rhel9Fix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-pilot-rhel9Fix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-proxyv2-rhel9Fix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-rhel9-operatorFix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-sail-operator-bundleFix deferred
OpenShift Service Mesh 3openshift-service-mesh/istio-ztunnel-rhel9Fix deferred
128 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-68146.

Attack patterns (CAPEC)

  • CAPEC-27 Leveraging Race Conditions via Symbolic Links Likelihood: Medium · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High
  • CAPEC-26 Leveraging Race Conditions Likelihood: High · Severity: High
  • CAPEC-17 Using Malicious Files Likelihood: High · Severity: Very High
  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-132 Symlink Attack Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON