Skip to content
Fencer Vulns
medium 6.3

CVE-2025-68146 json

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

published 2025-12-16 10 mo ago modified 2026-09-10 1 mo ago also GHSA-w853-jp5j-5j7f , PYSEC-2026-1375 , EUVD-2025-203839

cvss
6.3
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.2%
EPSS 0.2% chance of exploitation in 30 days, percentile 9%
public exploits
0
none known

Summary

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.

Patch / fix

  • pypi filelock 3.20.1
  • tox-dev filelock 3.20.1
  • python-filelock Debian 12 3.9.0-1+deb12u1
  • python-filelock Debian 13 3.18.0-1+deb13u1
  • python-filelock Debian 14 3.20.2-1

debian advisories DEBIAN-CVE-2025-68146

  • python-filelock Ubuntu Pro 18.04 LTS 3.0.4-1ubuntu0.1~esm1
  • python-filelock Ubuntu Pro 22.04 LTS 3.6.0-1ubuntu0.1~esm1
  • python-filelock Ubuntu Pro 24.04 LTS 3.13.1-1ubuntu0.1~esm1

ubuntu advisories UBUNTU-CVE-2025-68146

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python-filelock SLES for SAP applications 16.0, SLES 16.0 3.18.0-160000.3.1
  • python-filelock SLE Module for Python 3 15 SP7, openSUSE Leap 15.6 3.12.2-150400.10.8.1
  • python-filelock SLE Module for Package Hub 15 SP7, SLE Module for Development Tools 15 SP7 3.0.12-150100.3.6.1

suse advisories SUSE-SU-2026:20216-1SUSE-SU-2026:0220-1SUSE-SU-2026:0082-1

  • ansible-lint openSUSE Tumbleweed 26.11.0-2.1
  • python-filelock openSUSE Leap 16.0 3.18.0-160000.3.1
  • python-virtualenv openSUSE Tumbleweed 20.36.1-1.1
  • python-filelock openSUSE Tumbleweed 3.20.2-1.1

opensuse advisories openSUSE-SU-2026:12481-1openSUSE-SU-2026:20144-1openSUSE-SU-2026:10055-1openSUSE-SU-2026:10010-1

  • python-filelock Azure Linux 3.0 3.20.1-1

azure linux advisories AZL-72739

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2025-68146 updated cvss 6.3

filelock: filelock: Time-of-Check-Time-of-Use (TOCTOU) race condition and symlink attack allows arbitrary file corruption or truncation

  • Red Hat Migration Toolkit for Containers rhmtc/openshift-migration-hook-runner-rhel8 Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-ocp-rag-rhel9, openshift-lightspeed/lightspeed-service-api-rhel9, openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 Red Hat OpenShift Service Mesh 2 openshift-service-mesh/pilot-rhel8, openshift-service-mesh/grafana-rhel8, openshift-service-mesh/proxyv2-rhel9, openshift-service-mesh/istio-cni-rhel8, openshift-service-mesh/ratelimit-rhel8, openshift-service-mesh/istio-rhel8-operator, +2 more Red Hat OpenShift Service Mesh 3 openshift-service-mesh/istio-cni-rhel9, openshift-service-mesh/istio-pilot-rhel9, openshift-service-mesh/istio-proxyv2-rhel9, openshift-service-mesh/istio-ztunnel-rhel9, openshift-service-mesh/istio-rhel9-operator, openshift-service-mesh/istio-must-gather-rhel9, +3 more Red Hat AI Inference Server rhaiis/vllm-tpu-rhel9, rhaiis/vllm-cuda-rhel9, rhaiis/vllm-rocm-rhel9, rhaiis/vllm-spyre-rhel9, rhaiis/model-opt-cuda-rhel9, rhaiis-preview/vllm-cuda-rhel9 Red Hat Ansible Automation Platform 2 automation-controller, ansible-automation-platform-26/hub-rhel9, ansible-automation-platform-26/gateway-rhel9, ansible-automation-platform/ee-minimal-rhel8, ansible-automation-platform/ee-minimal-rhel9, ansible-automation-platform-26/mcp-tools-rhel9, +36 more
    +8 more products
    Red Hat Ansible Automation Platform Ansible Core 2 ansible-automation-platform/ee-minimal-rhel8, ansible-automation-platform/ee-minimal-rhel9, ansible-automation-platform-tech-preview/ee-minimal-rhel8, ansible-automation-platform-tech-preview/ee-minimal-rhel9 Red Hat Enterprise Linux AI (RHEL AI) rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/bootc-nvidia-rhel9, rhelai1/bootc-azure-amd-rhel9, rhelai1/instructlab-amd-rhel9, rhelai1/bootc-aws-nvidia-rhel9, +4 more Red Hat Enterprise Linux AI (RHEL AI) 3 rhelai3/bootc-cuda-rhel9, rhelai3/bootc-aws-cuda-rhel9, rhelai3/bootc-gcp-cuda-rhel9, rhelai3/disk-image-cuda-rhel9, rhelai3/bootc-azure-cuda-rhel9 Red Hat OpenShift AI (RHOAI) rhoai/odh-vllm-cpu-rhel9, rhoai/odh-vllm-cuda-rhel9, rhoai/odh-vllm-rocm-rhel9, rhoai/odh-caikit-nlp-rhel9, rhoai/odh-vllm-gaudi-rhel9, rhoai/odh-ta-lmes-job-rhel9, +40 more Red Hat OpenShift Dev Spaces devspaces/udi-rhel9, devspaces/udi-base-rhel9, devspaces/dashboard-rhel9, devspaces/udi-base-rhel10, devspaces/devspaces-operator-bundle Red Hat OpenStack Platform 18.0 rhoso-operators/ee-openstack-ansible-ee-rhel9 Red Hat Satellite 6 satellite/iop-puptoo-rhel9, satellite/iop-yuptoo-rhel9, satellite/iop-advisor-engine-rhel9, satellite/iop-host-inventory-rhel9, satellite/iop-advisor-backend-rhel9, satellite/iop-insights-engine-rhel9, +1 more Red Hat Trusted Artifact Signer rhtas/model-transparency-rhel9
    affected: workaround, no fix available “Fix deferred”

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
10 mo ago

Exploit prediction

0.20% chance of exploitation in the next 30 days, higher than 9% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/tox-dev/filelock/security/advisories/GHSA-w853-jp5j-5j7f referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 6.3 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
NVD 3.1 6.5 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
OSV 3.1 6.3 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
GitHub 3.1 6.3 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi filelock
<3.20.1
3.20.1

Affected products

  • tox-dev filelock

Classification

Weakness
  • CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
  • CWE-59 Improper Link Resolution Before File Access
  • CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.