CVE-2025-68146
published medium CVSS 3.1 · 6.3filelock has TOCTOU race condition that allows symlink attacks during lock file creation
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| tox-dev | — | filelock< 3.20.1 | Affected | Not stated | GitHub_M |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2026-1411 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2026-1415 | Fixed | Not stated | Amazon Linux assessment |
| SUSE / openSUSE | SLE-15-SP7 | python3-filelocknoarch | Advisory build | 3.0.12-150100.3.6.1 | SUSE-SU-2026:0082-1 |
| Ubuntu | bionic | python-filelock | Advisory build | 3.0.4-1ubuntu0.1~esm1 | USN-7999-1 |
| Amazon Linux | AL2023 | python-filelocknoarch | Listed in advisory | Not stated | ALAS2023-2026-1415 |
| SUSE / openSUSE | SLE-15-SP7 | python311-filelocknoarch | Advisory build | 3.12.2-150400.10.8.1 | SUSE-SU-2026:0220-1 |
| SUSE / openSUSE | SLE-16 | python313-filelocknoarch | Advisory build | 3.18.0-160000.3.1 | SUSE-SU-2026:20216-1 |
Show 41 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | SLE-3-SP7 | python311-filelocknoarch | Advisory build | 3.12.2-150400.10.8.1 | SUSE-SU-2026:0220-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | python311-filelocknoarch | Advisory build | 3.12.2-150400.10.8.1 | SUSE-SU-2026:0220-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | python313-filelocknoarch | Advisory build | 3.18.0-160000.3.1 | OPENSUSE-SU-2026:20144-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ansible-lintaarch64 | Advisory build | 26.11.0-2.1 | OPENSUSE-SU-2026:12481-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ansible-lintppc64le | Advisory build | 26.11.0-2.1 | OPENSUSE-SU-2026:12481-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ansible-lints390x | Advisory build | 26.11.0-2.1 | OPENSUSE-SU-2026:12481-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | ansible-lintx86_64 | Advisory build | 26.11.0-2.1 | OPENSUSE-SU-2026:12481-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-filelockaarch64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-filelockppc64le | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-filelocks390x | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-filelockx86_64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-virtualenvaarch64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-virtualenvppc64le | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-virtualenvs390x | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-virtualenvx86_64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-filelockaarch64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-filelockppc64le | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-filelocks390x | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-filelockx86_64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-virtualenvaarch64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-virtualenvppc64le | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-virtualenvs390x | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-virtualenvx86_64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-filelockaarch64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-filelockppc64le | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-filelocks390x | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-filelockx86_64 | Advisory build | 3.20.2-1.1 | OPENSUSE-SU-2026:10010-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-virtualenvaarch64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-virtualenvppc64le | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-virtualenvs390x | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-virtualenvx86_64 | Advisory build | 20.36.1-1.1 | OPENSUSE-SU-2026:10055-1 |
| Ubuntu | bionic | python3-filelock | Advisory build | 3.0.4-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | focal | python-filelock | Advisory build | 3.0.12-2ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | focal | python3-filelock | Advisory build | 3.0.12-2ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | jammy | python-filelock | Advisory build | 3.6.0-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | jammy | python3-filelock | Advisory build | 3.6.0-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | noble | python-filelock | Advisory build | 3.13.1-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu | noble | python3-filelock | Advisory build | 3.13.1-1ubuntu0.1~esm1 | USN-7999-1 |
| Amazon Linux | AL2023 | python-filelocksrc | Listed in advisory | Not stated | ALAS2023-2026-1415 |
| Amazon Linux | AL2023 | python3.13-filelocknoarch | Listed in advisory | Not stated | ALAS2023-2026-1411 |
| Amazon Linux | AL2023 | python3.13-filelocksrc | Listed in advisory | Not stated | ALAS2023-2026-1411 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.3 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| tox-dev | filelock | < 3.20.1 (affected) | GitHub_M · cna |
Weaknesses
3- CWE-367 CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
- CWE-59 CWE-59: Improper Link Resolution Before File Access ('Link Following')
- CWE-362 CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
References
4Provider assertions
2GitHub_M · cna
filelock has TOCTOU race condition that allows symlink attacks during lock file creation
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 6b0b8fedc24a5e866baebe5949a69870ef3a6b4b2d50e1b9d9ea604f12d20ba6
- Ingested
- 23 Sep 2026, 08:57:02 UTC
- Source record
- Official CVE record