Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain local account on shared host
-
ExploitSwap <path>.rw lock tree after first acquisition
-
ImpactRedirect holder's lock-record writes to attacker-writable directories
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
|
| Exploitation Conditions | Requires a separate, co-located local user account on the same host who can replace the |
| Impact | This is a low-severity, locally-exploitable TOCTOU flaw (CWE-367) whose signals are internally consistent and point to low real-world priority. The CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N, base 3.3) confirms local access and an already-authenticated local account are required, with only a low integrity impact and no confidentiality or availability loss. No EPSS score, CISA KEV listing, or public POC was provided in the input, so exploitation is assessed as no public exploit identified at time of analysis - this is NOT active exploitation and must not be treated as such. The only elevated signal is the ubiquity of the filelock library itself; however, the vulnerable SoftReadWriteLock/AsyncSoftReadWriteLock classes only exist from 4.1.0, narrowing the real exposure. Note a tag/impact conflict: the input Tags label this 'Information Disclosure', but the CVSS vector (C:N, I:L) and the description (redirecting lock-record WRITES) describe an integrity issue, not disclosure - the tag appears mislabeled. Net: a genuine but low-priority local race condition, not an urgent remote threat. |
| Exploit ScenarioDerived | On a multi-user host, a local user acquires a SoftReadWriteLock backed by a shared |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
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-located local user redirect the lock-record writes that SoftReadWriteLock and AsyncSoftReadWriteLock perform after acquisition - most notably periodic heartbeat rewrites of holder records - into directories writable by the lock-owning user. The root cause is a time-of-check/time-of-use gap: the classes cached the successful ownership check made at first acquisition and re-resolved the gen and holders names by path on every later record operation, so a tree swapped in during that window is followed. Impact is limited to integrity (CVSS 3.1 base 3.3, AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N) and requires an existing local account plus a lock path whose parent directory that account can modify; there is no remote vector, no public exploit identified at time of analysis, and no CISA KEV listing. The issue is fixed in filelock 4.2.1.
RemediationAI
Vendor-released patch: filelock 4.2.1 - upgrade with pip install --upgrade filelock>=4.2.1 and pin the minimum version in dependency constraints so transitive consumers inherit the fix; the change is commit bfa066d65a1ba9106f86ee9d027f7588b9c77e03 (PR https://github.com/tox-dev/filelock/pull/842), and release notes are at https://github.com/tox-dev/filelock/releases/tag/4.2.1 with the advisory at https://github.com/tox-dev/filelock/security/advisories/GHSA-wfhq-q4j2-c37m. Where upgrading is not immediately possible, the practical mitigation is to place lock paths only inside directories whose parent is owned by the locking account and not writable by any other account (mode 0700 or stricter on the parent), which removes the attacker's ability to replace <path>.rw at all; the trade-off is that genuinely shared lock locations - commonly world-writable temp directories such as /tmp - stop working for multi-user coordination and must be relocated to a per-user or service-owned runtime directory. Administrators can also detect lingering exposure by auditing existing lock paths for <path>.rw trees whose ownership or type (symlink, junction) does not match the expected real directory, since a replaced tree is the observable artifact of this attack. Single-user and non-shared deployments are not realistically exposed and can treat the upgrade as routine hygiene.
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's soft read-write locking protocol stores coordination state in a <path>.rw directory tree containing gen and holders subdirectories, where each holder writes a record file that it periodically refreshes via a heartbeat thread so other processes can detect staleness. CWE-367 (Time-of-Check Time-of-Use) applies because the ownership/type check of that tree was performed once at acquisition and the result cached; subsequent operations re-resolved the gen/holders names through the filesystem instead of through descriptors pinned to the verified directories. On POSIX the fix opens <path>.rw and then gen/holders with dir_fd and does not follow symlinks for each record operation; on Windows it holds the directories open and refuses junctions (directories that point at another directory). The patch additionally makes create() return the file's device and inode identity so overwrite() can confirm the name still leads to the file that was created (and that the file has no second name, i.e. no hard link), opens records without blocking on FIFOs, and introduces a TreeReplacedError so a heartbeat that finds the tree replaced reports the hold as lost rather than crashing the heartbeat thread. A live lock object now repeats the ownership check whenever a directory it opens is not the one it prepared.
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:L/A:N
Exploitation needs an existing local account (AV:L, PR:L) and a persistent attacker-controlled swap window rather than a tight race (AC:L); only lock-record integrity is affected (I:L, C:N, A: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, SoftReadWriteLock and AsyncSoftReadWriteLock cache a successful check of the <path>.rw lock tree and resolve its names again during later record operations, allowing another local user who can replace that tree after the first acquisition to redirect lock-record writes into directories writable by the lock user. 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
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
A time-of-check-to-time-of-use (TOCTOU) flaw in the Python filelock library's ReadWriteLock, present from 4.1.0 through
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
EUVD-2026-105032
NVD
CVE.org
EPSS
GitHub
Exploit-DB