CVE-2026-112910
Windows file locks ignore mode, exposing lock files to other local users.
- CVSS 5.3
- CWE-732
- Information Leakage
- Local
filelock is a platform-independent file lock for Python. From 3.10.0 until 4.2.1, filelock on Windows ignores the mode argument for WindowsFileLock files and the ReadWriteLock SQLite database. A lock created with mode=0o600 receives the parent directory's inheritable ACL because _open_non_reparse_fd and _nt_open do not create an owner-only security descriptor. Another local account with inherited access can read holder metadata or the lock database, modify those files where the ACL permits writes, or take the byte-range lock after release and delay later acquisitions. UnixFileLock is not affected, and mutual exclusion between cooperating processes continues to hold. This issue is fixed in version 4.2.1.
- CWE
- CWE-732
- CVSS base score
- 5.3
- Published
- 2026-11-05
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Assignment
- Code defect classification
- Incorrect Assignment
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Local
- Impact
- Unauthorized Access
- Affected component
- filelock
- Fixed by upgrading
- Yes
Solution
Upgrade filelock to ≥ 4.2.1.
Vulnerable code sample
import os
from filelock import FileLock
def acquire_shared_lock(lock_path: str):
# VULNERABLE: creates lock file with overly permissive ACL on Windows
lock = FileLock(lock_path, mode=0o600)
lock.acquire()
# critical section would go here
lock.release()Patched code sample
import os
from filelock import FileLock
def acquire_shared_lock(lock_path: str):
# FIX: omit mode to let FileLock use a secure descriptor on Windows
lock = FileLock(lock_path)
lock.acquire()
# critical section would go here
lock.release()Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- =?UTF-8?q?=F0=9F=90=9B=20fix(open):=20keep=20lock=20files?= (tox-dev/filelock)
src/filelock/_api.py · BaseFileLock.__init__,src/filelock/_descriptor.py,src/filelock/_read_write.py,src/filelock/_read_write.py · ReadWriteLock._open_connection,src/filelock/_read_write.py · _connect,src/filelock/_read_write.py · _open_lock_database,src/filelock/_soft.py,src/filelock/_soft.py · SoftFileLock._windows_unlink_if_ours,src/filelock/_soft.py · _read_lock_file,src/filelock/_strict.py,src/filelock/_unix.py,src/filelock/_util.pyand 4 more
Cite this entry
@misc{vaitp:cve2026112910,
title = {{Windows file locks ignore mode, exposing lock files to other local users.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-112910},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-112910/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
