Skip to main content

filelock EUVDEUVD-2026-105032

| CVE-2026-112941 LOW
Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367)
2026-10-20 GitHub_M
3.3
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. Exploit
    Swap <path>.rw lock tree after first acquisition
  3. Impact
    Redirect 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 <path>.rw lock directory tree (via symlink or junction) after the first successful acquisition but before later record operations such as periodic heartbeat rewrites, exploiting that SoftReadWriteLock/AsyncSoftReadWriteLock cached the earlier ownership check and re-resolved names. Limited to filelock versions 4.1.0 through 4.2.0 using these specific read-write lock classes, and only where the lock tree resides in a location another account can modify; it requires local access and an existing local account (PR:L), there is no remote vector, and the attacker must act within the window between acquisition and record operations, so default single-user or non-shared deployments are not realistically exposed.

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 <path>.rw tree that passes an initial ownership check. A second, co-located local user then replaces that tree (e.g., via a symlink or junction) before the lock holder performs later record operations such as heartbeat rewrites, causing the holder to write lock records into directories the attacker controls. No public exploit code was identified, and exploitation is bounded by the attacker needing their own local account and timing against the holder's record operations.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.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

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

filelock 4.1.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'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

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

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

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Oct 20, 2026 - 16:02 EUVD
CVE Published
Oct 20, 2026 - 14:43 cve.org
LOW 3.3

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

EPSS Score
0.1%
Top 100% exploitable
Prevalence
High
filelock is a near-ubiquitous Python dependency, but flaw limited to newer versions
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 LOW
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.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

16
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +16
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-112935 MEDIUM
4.7 Oct 20

The Python filelock library (versions 3.22.0 through 4.2.0) can admit two simultaneous lock holders because its SoftFile

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

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