Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLocal account on shared host
-
DeliveryGain rename rights in non-sticky parent dir
-
ExploitObserve live .filelock-* name or forge dead-owner sweep name
-
ExecutionRename sibling directory onto that name
-
ImpactVictim cleanup deletes attacker-chosen directory
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
|
| Exploitation Conditions | Exploitation requires: (1) a local account on the same host as the victim process; (2) rename access in a parent directory above the lock's database that is writable by group/others AND lacks the sticky bit (so the attacker can rename entries they do not own); and (3) the target application using filelock's ReadWriteLock (versions 4.1.0 through 4.2.0) with its database placed in such a shared directory, where filelock falls back to the randomized .filelock-* private-hard-link directory. LIMITING FACTORS: there is no remote or network vector (AV:L); a valid local authenticated user is required (PR:L); and default-secure deployments are NOT affected - when the database directory is owned by the locking account or root and is not group/other-writable, or when parent directories carry the sticky bit (e.g. a properly configured /tmp), the preconditions do not hold. |
| Impact | This is a genuine but narrowly-scoped medium-severity issue (CVSS 6.1), not a top-tier priority for most environments. The supplied CVSS vector (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L) and CWE-367 (TOCTOU race) agree that this is a LOCAL, authenticated, same-host attack - there is no network vector and no remote mass-exploitation potential. The impact is integrity-centric (I:H: an attacker-chosen sibling directory gets deleted/replaced via the victim process's cleanup) with limited availability impact (A:L) and no confidentiality impact (C:N). No EPSS score, no CISA KEV listing, and no public POC were provided, so there is no public exploit identified at time of analysis and no evidence of exploitation in the wild; the risk profile points to targeted local privilege-boundary abuse on multi-user hosts rather than opportunistic widespread attack. CONFLICT TO NOTE: the input carries an 'Information Disclosure' tag, but the authoritative CVSS vector sets C:N - this is a data-destruction/integrity flaw, not information disclosure, so the tag should be disregarded. Overall prioritize only where filelock's ReadWriteLock runs in a shared, world/group-writable, non-sticky directory alongside untrusted local accounts; elsewhere the preconditions make real-world risk low. |
| Exploit ScenarioDerived | On a shared multi-user POSIX host, a local attacker with rename access in a non-sticky parent directory above an application's filelock ReadWriteLock database observes the randomized .filelock-* private-hard-link directory name (or forges a dead-owner sweep name) and renames a sibling directory onto that name. During cleanup the legitimate lock-holding process then deletes the attacker-substituted directory. No public exploit code was identified, and exploitation requires an existing local account and specific writable-directory conditions. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
A time-of-check-to-time-of-use (TOCTOU) flaw in the Python filelock library's ReadWriteLock, present from 4.1.0 through 4.2.0, allows a second local account to abuse rename rights in a shared, non-sticky parent directory to observe the randomized .filelock-* private hard-link directory name or forge a dead-owner sweep name, then rename a sibling directory onto that name so the lock's cleanup deletes it - producing high integrity impact with limited availability impact on data the attacker does not own. Exploitation requires a local account on the same host, rename access in a parent directory that is group/other-writable and lacks the sticky bit, and an application that places its ReadWriteLock database in such a shared location; deployments where the database directory is owned by the locking account or root and is not group/other-writable, or where parent directories are sticky, are not affected. The issue is fixed in 4.2.1, and no public exploit code was identified at time of analysis.
RemediationAI
Upgrade to filelock 4.2.1 (pip install 'filelock>=4.2.1'), which is the vendor-released patch; the change is carried in pull request https://github.com/tox-dev/filelock/pull/834 and commit 5e3f2ec0c5fb17cb2635b60b2b68bc63ab81ca2d, with details in advisory https://github.com/tox-dev/filelock/security/advisories/GHSA-jqc4-5cvw-7w85. Where upgrading is delayed, the precondition can be removed rather than the code: relocate ReadWriteLock databases into a directory owned by the locking account (or root) that is not writable by group or others, which makes filelock name the database directly and skips the vulnerable link-directory sweep entirely - the trade-off is that shared multi-tenant database locations must be redesigned, often moving state under a per-service or per-user path. Ensure every directory above the database is either not writable by others or carries the sticky bit, since non-sticky world-writable parents are what let an attacker rename entries; note that the sticky bit prevents only cross-owner renames, so a directory the attacker owns still grants the needed right. On Windows, restrict the database directory's ACL to the locking account, SYSTEM and Administrators so filelock's ACL check classifies it as private, and where hard links are unsupported place the database under a private directory such as %LOCALAPPDATA% - the trade-off being that a filesystem without hard links causes filelock to raise OSError instead of locking. Each of these controls is a configuration change with no code deployment, but none of them protects an application that continues to hold a lock database in a shared, non-sticky writable directory.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
filelock is a platform-independent file locking library for Python, and its ReadWriteLock class layers a lock around a SQLite database to coordinate readers and writers; on POSIX it avoids SQLite's sidecar -journal, -wal and -shm name collisions by exposing the database through a randomized .filelock-* directory containing a private hard link, and cleanup subsequently removes that link directory. The root cause is CWE-367, a race between the check of that directory and its use: prior to the fix, cleanup resolved and removed the link directory by name rather than through an already-opened, verified descriptor, so a process able to rename entries in a parent directory that is writable by group or others and lacks the sticky bit could park a sibling directory on the live name and have the sweep delete it, or use the observed name to forge a dead-owner sweep. The 4.2.1 fix changes cleanup to operate through a checked descriptor, reads a link directory's name only when the locking account owns it, and leaves untouched a directory with other content that has been renamed onto a link directory's name; the same advisory additionally hardens SQLite path handling by opening the database by name only in a directory no other account can write and otherwise through the private hard link, with Windows decisions driven by the directory's access control list (owner, SYSTEM and Administrators only) and an OSError raised where hard links are unavailable. The affected CPE is cpe:2.3:a:tox-dev:filelock:*:*:*:*:*:*:*:*, i.e. the upstream tox-dev Python package itself rather than any OS-bundled component.
Know when Filelock gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Local co-tenant with rename rights in a non-sticky parent (AV:L, PR:L); forging a dead-owner sweep name avoids a tight race (AC:L); causes deletion of an attacker-chosen directory (I:H, A:L) with no data disclosure (C:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
filelock is a platform-independent file lock for Python. From 4.1.0 until 4.2.1, ReadWriteLock can remove a randomized .filelock-* private-hard-link directory during cleanup, allowing another local user with rename access in a non-sticky parent to observe a live name or forge a dead-owner sweep name and rename a sibling directory onto it for deletion. This issue is fixed in version 4.2.1.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
filelock's SQLite-backed ReadWriteLock (versions 3.20.4 through 4.2.0) can be tricked into overwriting or unlinking the
The Python `filelock` package's opt-in `StrictSoftFileLock` (3.30.0 through <4.2.1) and `SoftReadWriteLock` (4.0.0 throu
Symlink redirection in filelock's ReadWriteLock and AsyncReadWriteLock (versions 3.20.4 through 4.0.8) allows a local us
SoftReadWriteLock in the Python filelock package (4.0.0 through 4.2.0) refreshes holder records by pathname without veri
Python filelock's UnixFileLock truncates a regular file that a second local user has renamed onto the lock path (or hard
Local denial of service in the Python `filelock` package (versions 3.20.4 through 4.2.0) allows a second local account t
A local, low-privileged user (PR:L) who can rename files in a shared, non-sticky-bit lock directory can abuse the Python
Python's filelock SoftFileLock implementation prior to version 3.20.3 contains a TOCTOU race condition that allows local
SoftFileLock, MarkerSoftFileLock, and SoftFileLease in the Python filelock package from 3.22.0 through 4.2.0 can be tric
The Python filelock library (versions 3.22.0 through 4.2.0) can admit two simultaneous lock holders because its SoftFile
Python's filelock library, versions 4.1.0 through 4.2.0, allows a local attacker who is already contending on the same l
Symlink or junction replacement of the `<path>.rw` lock tree in Python's filelock 4.1.0 through 4.2.0 lets a second, co-
EUVD-2026-105028
NVD
CVE.org
EPSS
GitHub
Exploit-DB