Skip to main content

filelock CVE-2026-112937

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

Attack ChainAIDerived

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

  1. Access
    Local account on shared host
  2. Delivery
    Gain rename rights in non-sticky parent dir
  3. Exploit
    Observe live .filelock-* name or forge dead-owner sweep name
  4. Execution
    Rename sibling directory onto that name
  5. Impact
    Victim 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.

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

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

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

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

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

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/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
High
Availability
Low

Lifecycle Timeline

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

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

EPSS Score
0.1%
Top 100% exploitable
Prevalence
High
extremely popular Python locking dependency; vulnerable ReadWriteLock feature is new and narrowly used
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

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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

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