Skip to main content

Python filelock EUVDEUVD-2026-105025

| CVE-2026-112935 MEDIUM
Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367)
2026-10-20 GitHub_M
4.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain local account on shared host
  2. Delivery
    Win SoftFileLock stale-marker break race
  3. Exploit
    Free own marker after stale read
  4. Execution
    Honest peer reuses inode as live successor
  5. Impact
    Live 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

filelock 3.22.0, < 4.2.1

Affected Packages

euvd filelock fix: 4.2.1

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

Vendor (GitHub_M) PRIMARY 4.7 MEDIUM
AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
4.0 AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Oct 20, 2026 - 16:02 EUVD
CVE Published
Oct 20, 2026 - 14:32 cve.org
MEDIUM 4.7

DescriptionCVE.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

EPSS Score
0.1%
Top 100% exploitable
Prevalence
High
extremely popular Python locking library, but vulnerable SoftFileLock mode is non-default
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
High

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0
CVE-2026-112940 HIGH
7.1 Oct 20

filelock's SQLite-backed ReadWriteLock (versions 3.20.4 through 4.2.0) can be tricked into overwriting or unlinking the

CVE-2026-112911 MEDIUM
6.3 Oct 20

The Python `filelock` package's opt-in `StrictSoftFileLock` (3.30.0 through <4.2.1) and `SoftReadWriteLock` (4.0.0 throu

CVE-2026-112936 MEDIUM
6.1 Oct 20

Symlink redirection in filelock's ReadWriteLock and AsyncReadWriteLock (versions 3.20.4 through 4.0.8) allows a local us

CVE-2026-112934 MEDIUM
6.1 Oct 20

SoftReadWriteLock in the Python filelock package (4.0.0 through 4.2.0) refreshes holder records by pathname without veri

CVE-2026-112909 MEDIUM
6.1 Oct 20

Python filelock's UnixFileLock truncates a regular file that a second local user has renamed onto the lock path (or hard

CVE-2026-112937 MEDIUM
6.1 Oct 20

A time-of-check-to-time-of-use (TOCTOU) flaw in the Python filelock library's ReadWriteLock, present from 4.1.0 through

CVE-2026-112915 MEDIUM
5.5 Oct 20

Local denial of service in the Python `filelock` package (versions 3.20.4 through 4.2.0) allows a second local account t

CVE-2026-112914 MEDIUM
5.3 Oct 20

A local, low-privileged user (PR:L) who can rename files in a shared, non-sticky-bit lock directory can abuse the Python

CVE-2026-22701 MEDIUM
5.3 Jan 10

Python's filelock SoftFileLock implementation prior to version 3.20.3 contains a TOCTOU race condition that allows local

CVE-2026-112939 MEDIUM
4.7 Oct 20

SoftFileLock, MarkerSoftFileLock, and SoftFileLease in the Python filelock package from 3.22.0 through 4.2.0 can be tric

CVE-2026-112906 MEDIUM
4.7 Oct 20

Python's filelock library, versions 4.1.0 through 4.2.0, allows a local attacker who is already contending on the same l

CVE-2026-112941 LOW
3.3 Oct 20

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-

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy