CVE-2026-112908
Improper directory permissions let other users delete or spoof file‑lock claims, bypassing the lock.
- CVSS 5.3
- CWE-732
- Configuration Issues
- Local
filelock is a platform-independent file lock for Python. From version 3.30.0 until version 4.2.1, StrictSoftFileLock and AsyncStrictSoftFileLock on POSIX systems create coordination and claim directories without applying the caller’s restrictive lock mode. A permissive umask or inherited default ACL can leave these directories writable by another local user, allowing that user to delete an active holder’s claims. Another authorized process can then acquire the lock while the original holder remains in its critical section. An attacker can also plant malformed claims to prevent acquisition. 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
- Timing/Serialization
- Code defect classification
- Serialization Issues
- Category
- Configuration Issues
- Subcategory
- Insecure Direct Object References (IDOR)
- Accessibility scope
- Local
- Impact
- Unauthorized Access
- Affected component
- filelock
- Fixed by upgrading
- Yes
Solution
Upgrade filelock to version 4.2.1 or later.
Vulnerable code sample
import os
from filelock import StrictSoftFileLock
def process_shared_resource(path: str):
lock_path = os.path.join(path, "resource.lock")
# VULNERABLE: creates lock directory with default (permissive) mode
lock = StrictSoftFileLock(lock_path)
with lock:
# critical section accessing shared files
with open(os.path.join(path, "data.txt"), "a+") as f:
f.write("update\n")Patched code sample
import os
from filelock import StrictSoftFileLock
def process_shared_resource(path: str):
lock_path = os.path.join(path, "resource.lock")
# FIX: enforce restrictive directory mode (0o700) for lock claims
lock = StrictSoftFileLock(lock_path, mode=0o700)
with lock:
# critical section accessing shared files
with open(os.path.join(path, "data.txt"), "a+") as f:
f.write("update\n")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.
- fix(strict): apply the mode to claim directories (tox-dev/filelock)
src/filelock/_strict.py · StrictSoftFileLock._acquire,src/filelock/_strict.py · _ensure_protocol_directory - =?UTF-8?q?=F0=9F=90=9B=20fix(strict):=20keep=20claim=20di?= (tox-dev/filelock)
src/filelock/_lease.py,src/filelock/_soft_rw/_protocol.py,src/filelock/_soft_rw/_protocol.py · Files.create,src/filelock/_soft_rw/_protocol.py · Files.overwrite,src/filelock/_soft_rw/_protocol.py · GenerationLog.commit,src/filelock/_soft_rw/_protocol.py · GenerationLog._extends_the_log,src/filelock/_soft_rw/_protocol.py · GenerationLog._list,src/filelock/_soft_rw/_protocol.py · Ledger.observe,src/filelock/_soft_rw/_protocol.py · Participant.heartbeat,src/filelock/_soft_rw/_protocol.py · Participant.leave,src/filelock/_soft_rw/_protocol.py · Participant._create_holder,src/filelock/_soft_rw/_protocol.py · Participant._refresh_nonceand 44 more
Cite this entry
@misc{vaitp:cve2026112908,
title = {{Improper directory permissions let other users delete or spoof file‑lock claims, bypassing the lock.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-112908},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-112908/}}
}
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 ::
