Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain local account on shared host
-
DeliveryWin SoftFileLock stale-marker break race
-
ExploitFree own marker after stale read
-
ExecutionHonest peer reuses inode as live successor
-
ImpactLive marker removed, two holders admitted
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
|
| Exploitation Conditions | Requires: (1) use of filelock's SoftFileLock, MarkerSoftFileLock, or SoftFileLease class (not the default hard FileLock) at versions 3.22.0 through 4.2.0; (2) a filesystem that recycles freed inode numbers to the next file, explicitly ext4 per the advisory; (3) a local account with write access to the lock directory on a shared host; and (4) the attacker winning a narrow TOCTOU window - freeing their own marker after the stale read while an honest contender creates a live successor on the reused inode whose modification time is not newer than the saved observation. LIMITING FACTORS: exploitation is local only (AV:L), needs an authenticated local user (PR:L), has high attack complexity because it depends on winning a race and on inode-number reuse (AC:H), and does not apply to deployments using the default FileLock or non-inode-reusing/atomic-exchange platforms (Linux renameat2 / macOS renamex_np paths are the fixed design). |
| Impact | This is a genuine but low-urgency correctness flaw rather than a high-impact priority. The CVSS 3.1 vector (AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N, base 4.7 Medium) describes a locally exploitable TOCTOU race (CWE-367) that an already-authenticated local user can win only under high complexity. There is no public exploit identified at time of analysis, no CISA KEV listing, and no EPSS score was supplied, so there is no evidence of active or opportunistic exploitation - consistent with a timing-race bug that is hard to weaponize remotely or at scale. The only impact is integrity (I:H): the SoftFileLock stale-marker break logic can be driven to remove a live holder's marker so two holders are admitted at once, defeating mutual exclusion. CONFLICTING SIGNAL: the input Tags label this 'Information Disclosure', but the CVSS vector sets C:N (no confidentiality impact) and I:H - the real consequence is broken mutual exclusion / possible corruption of the protected resource, not data disclosure; the tag appears mislabeled. Net: patch opportunistically on multi-user or shared-filesystem hosts that rely on SoftFileLock, but this is not a drop-everything issue given AC:H, AV:L, PR:L and the absence of any exploitation evidence. |
| Exploit ScenarioDerived | On a shared multi-user host where applications use filelock's SoftFileLock (3.22.0-4.2.0) on an inode-reusing filesystem such as ext4, a local user with a normal account repeatedly creates and frees their own lock markers to manipulate the stale-marker break sequence. By freeing their marker after the stale read while an honest process creates a live successor on the reused inode whose mtime is not newer than the saved observation, the attacker causes the live marker to be removed and two holders to be admitted simultaneously, breaking the lock's guarantee and risking corruption of whatever it protects. No public exploit code is known to exist. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
The Python filelock library (versions 3.22.0 through 4.2.0) can admit two simultaneous lock holders because its SoftFileLock, MarkerSoftFileLock and SoftFileLease classes mishandle stale-marker breaking when the underlying filesystem recycles a freed inode number. A local attacker with write access to the lock directory who wins a narrow race - freeing their own marker after the stale read, while an honest contender creates a live successor on the reused inode whose modification time is not newer than the saved observation - can cause the honest holder's live marker to be deleted, producing a mutual-exclusion failure with integrity impact. Exploitation requires a local, authenticated account on a shared host, a filesystem that reuses inode numbers (ext4 is named in the advisory), and the non-default soft lock classes; attack complexity is high and no public exploit code was identified at time of analysis, and the issue is not in CISA KEV. The vendor-released patch is 4.2.1.
RemediationAI
Vendor-released patch: upgrade filelock to 4.2.1, which is the version where the atomic-exchange break, ctime-aware marker identity, same-host breaker validation, and stranded-marker recovery logic land (release notes at https://github.com/tox-dev/filelock/releases/tag/4.2.1, changelog and implementation in PR https://github.com/tox-dev/filelock/pull/843 and commit 740ff666b62a88496c8d7394e4e6230605e4d62b, advisory GHSA-fq56-3cx3-fjxp). If upgrading immediately is not possible, the most effective compensating control is to stop using the soft classes: construct FileLock (the default hard lock) instead of SoftFileLock, MarkerSoftFileLock or SoftFileLease, and set fallback_to_soft=False where a soft fallback is configured so that acquisition fails closed rather than degrading to the vulnerable userspace marker - the trade-off is that locking will then error on filesystems that cannot provide a hard lock (notably some NFS and SMB mounts), which must be handled as an explicit application failure. A second control is to make the lock directory non-writable by untrusted local accounts (tighten directory ownership and modes, or isolate the workload so the lock path is not shared with other tenants), which removes the attacker's precondition of being able to place and free a marker on the same inode; this is effective but constrains multi-tenant deployment models. Because the fixed design relies on atomic rename exchange, prefer running on Linux or macOS, where renameat2 and renamex_np are used, over network filesystems where the 4.2.1 behaviour is to leave the marker in place and block until timeout or break_lock(). Note that exploitation is local, high-complexity and race-dependent, so inventorying which applications actually use the soft classes is the fastest way to scope urgency.
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 implements cross-platform advisory file locking in Python, and its soft variants implement locking in userspace by writing a marker file containing an owner record (PID plus a process start token) rather than relying on kernel lock primitives, because some filesystems (NFS, SMB, and platforms lacking a usable flock/fcntl path) cannot provide reliable hard locks. Correctness therefore depends on stale-marker reclamation: a contender that observes an aged or dead marker re-reads its identity and only breaks it if nothing changed, typically by renaming the marker to a private <lock>.break.<pid>.<token> name and verifying inode and modification time again. This is a classic CWE-367 time-of-check/time-of-use race. The root cause here is that the safety check relied on inode number and modification time, both of which an attacker can influence: ext4 (and similar inode-reusing filesystems) hands a freed inode number to the next created file, and an owner can set a file's modification time, so a freshly created live marker can appear identical - or not newer - relative to the saved observation. An attacker who frees their own marker after the stale read lets an honest contender publish a live successor onto the reused inode; the successor's mtime is not newer than the saved observation, so the breaker deletes the live marker and both parties believe they hold the lock. The upstream fix in 4.2.1 hardens the algorithm on several fronts: on Linux (renameat2) and macOS (renamex_np) the break becomes a single atomic exchange of a complete private marker with the marker at the lock path, so the lock path is never left empty; on platforms without an atomic exchange (NFS, SMB, and others except Windows) the marker stays in place and the contender waits for timeout or an explicit break_lock(); marker identity now incorporates change time (ctime), which no process can set, alongside mtime and inode, so a new marker cannot inherit the age of the file it replaced; breaker ownership is validated by matching the process number on the same host; symlinks found under the break name are no longer followed when restoring a marker; and stranded restore claims left by dead breakers or failed put-backs are recovered or retried on the next poll. The affected surface is limited to deployments that opt into SoftFileLock, MarkerSoftFileLock or SoftFileLease on an inode-reusing shared filesystem where untrusted local users can write to the lock directory; the default hard FileLock path is not affected by this specific race.
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:H/PR:L/UI:N/S:U/C:N/I:H/A:N
Local shared-filesystem access gives AV:L and PR:L; winning the TOCTOU race on reused inodes makes it AC:H; only mutual-exclusion integrity is affected, so C:N/I:H/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 3.22.0 until 4.2.1, SoftFileLock can break a stale marker after an attacker frees its own marker following the stale read, an honest contender creates a live successor on the reused inode, and the successor's modification time is not newer than the saved observation, causing the live marker to be removed and two holders to be admitted. 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
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-105025
NVD
CVE.org
EPSS
GitHub
Exploit-DB