Skip to main content

Python filelock CVE-2026-112909

| EUVDEUVD-2026-105017 MEDIUM
Use of Incorrectly-Resolved Name or Reference (CWE-706)
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
    Obtain local user account on host
  2. Exploit
    Rename or hard-link target file onto lock path
  3. Execution
    Victim application acquires UnixFileLock
  4. Impact
    Target file truncated or mode changed

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incorrectly specified target
Exploitation Conditions

Requires a second local user who has rename permission on the directory holding the UnixFileLock lock file (e.g. a group- or world-writable shared lock directory), OR a system with a permissive hard-link policy (Linux sysctl fs.protected_hardlinks=0) that lets the attacker hard-link an arbitrary target file onto the lock path. The mode-changing variant additionally requires the application to request an explicit mode and affects versions from 3.10.2 onward. Limiting factors: the attacker must already have a local account and write/rename access to the lock directory; default Linux hard-link protection (fs.protected_hardlinks=1) neutralizes the hard-link vector; applications that place lock files in per-user private directories not writable by others are not exposed; there is no remote or unauthenticated path.

Impact

This is a locally-exploitable, medium-severity integrity flaw, not an urgent remote threat. The provided CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N, base 6.1) confirms the attacker must already hold a local account (PR:L) on the same host and have rename or hard-link access to the directory containing the lock file - there is no network vector. No EPSS score, no CISA KEV listing, and no POC were supplied in the input, so there is no signal of active or probable exploitation; exploitation status is 'no public exploit identified at time of analysis.' SSVC decision data was not provided. The signals are internally consistent (local vector matches a 'another local user' description), but note the 'Information Disclosure' tag understates the real impact: the dominant consequence is integrity/data-destruction (I:H, file truncation), with confidentiality only minor (C:L, from a possible mode change). Net: a legitimate but low-to-moderate-priority issue - patch in normal cycles, prioritized only where lock files sit in directories writable by untrusted local users.

Exploit ScenarioDerived

On a host where an application places its lock file in a directory shared with other local users, an attacker with rename permission renames (or, under a permissive hard-link policy, hard-links) a victim's regular file onto the lock path. When the victim's application next calls acquire() on its UnixFileLock, affected filelock versions open that planted file as their own lock file and truncate it, destroying its contents; if the application requested an explicit mode, versions from 3.10.2 also change the file's permission bits. No public exploit code is identified at time of analysis.

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

Python filelock's UnixFileLock truncates a regular file that a second local user has renamed onto the lock path (or hard-linked there when hard-link protections are relaxed), destroying that file's contents; when an explicit mode is requested, versions from 3.10.2 onward can additionally fchmod the file to the lock's mode. Exploitation requires a low-privileged local account (CVSS PR:L) plus rename/write permission on the directory holding the lock file, or a host with fs.protected_hardlinks disabled, so only multi-user shared lock directories and permissive-hardlink systems are exposed - no remote or unauthenticated path exists. Fixed in 4.2.1; no public exploit identified at time of analysis, and EPSS/KEV data are not available for this CVE.

RemediationAI

Upgrade to filelock 4.2.1 or later - the vendor-released patch (https://github.com/tox-dev/filelock/releases/tag/4.2.1, advisory GHSA-69hj-f68j-2879, fix PR https://github.com/tox-dev/filelock/pull/835, commit e1e825b1992f69fb6b346dc395d5ae4893536c0a); because filelock is usually a transitive dependency, enumerate it with pip-audit or pip show filelock and pin the patched version in every environment, including CI images and build caches where lock files live. If upgrading is not immediately possible, the effective compensating controls are: (1) place lock files in a per-user directory created with mode 0700 and never in a group- or world-writable shared directory - this removes the attacker's rename primitive entirely, at the cost that cross-user coordination must be redesigned around a broker or per-user lock plus a separate coordination channel; (2) keep the Linux default hard-link protection enabled (fs.protected_hardlinks=1, verify with sysctl) - this neutralizes the hard-link vector but does nothing against the rename vector, and disabling it systemwide weakens protection for other software; (3) avoid passing an explicit mode to UnixFileLock on affected versions so the fchmod variant cannot apply, accepting that the truncation variant remains possible; (4) if the lock path may be attacker-influenced, wrap it so the parent directory is validated as owned by the running user and non-writable by others before locking. Auditing for prior exploitation is difficult because the truncated file is simply left empty, so check shared lock and cache directories for zero-length files whose owners do not match the writing process.

Affected VersionsENISA

filelock < 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 advisory file-locking library used by pip, virtualenv, tox, and many Python build/cache tools to serialize access to shared resources. UnixFileLock opens the lock path with O_NOFOLLOW to defeat symlink redirection and then locks it with flock(2), but O_NOFOLLOW does not catch a hard link (a second name for the same file) or a plain rename of an attacker-chosen file onto the lock path; the resulting object is indistinguishable from a real lock file. Because the implementation treated whatever it opened as its own artifact, it truncated the file and, when an explicit mode was passed, applied fchmod to it. This is CWE-706 (Use of Incorrectly-Resolved Name or Reference): the code resolves a pathname to a file object and then operates on that object based on the assumption - never verified - that it created it. The fix in 4.2.1 makes UnixFileLock lock a file it did not create as found, without truncating it or changing its mode, moves truncation responsibility into the on_acquired hook that writes holder metadata, stops soft-lock writability checks from following a symlink swapped in at the lock path, and tightens several related oplock/lease and Windows ACL behaviors. Practical consequence of the flaw: an attacker with rename rights in the lock directory can cause the victim application to destroy or permission-alter any file the victim's process can open, which is why integrity impact is rated High while confidentiality is Low.

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:L/I:H/A:N
vuln.today AI 6.1 MEDIUM

Local attacker needs an account with rename/link access to the lock directory (AV:L, PR:L); file truncation yields I:H, while a mode change leaks minor confidentiality (C:L), no availability impact.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/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
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

Lifecycle Timeline

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

DescriptionCVE.org

filelock is a platform-independent file lock for Python. Prior to 4.2.1, UnixFileLock can truncate a regular file renamed onto the lock path when another local user has actual rename permission, or hard-linked there under a permissive hard-link policy; when an explicit mode is requested, affected versions from 3.10.2 can also change that file's mode. This issue is fixed in version 4.2.1.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Prevalence
High
extremely popular Python locking library, transitive dependency of tox/virtualenv/huggingface
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
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

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

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