VAITP Dataset

← Back to the dataset

CVE-2026-112913

SQLite file lock bypass via writable temp dir causing lock acquisition failures.

  • CVSS 3.3
  • CWE-367
  • Configuration Issues
  • Local

filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock and AsyncReadWriteLock on Windows use _connect to attach SQLite to the lock database by pathname, allowing another local account that can create adjacent names to place a database-wal or database-journal side file before acquisition. An undeletable WAL file makes each read or write acquisition fail immediately with sqlite3.OperationalError regardless of timeout. Separately, when the database contains at least one table, a hot journal that grants the lock account modify rights can cause SQLite recovery to delete a file named by that journal only when the lock account has permission to delete the target. The issue requires a directory writable by another account, such as a shared Windows temporary directory, and does not affect private directories. This issue is fixed in version 4.2.1.

CVSS base score
3.3
Published
2026-11-05
OWASP
A01 Broken Access Control
Orthogonal defect classification
Timing/Serialization
Code defect classification
Incorrect Check
Category
Configuration Issues
Subcategory
Local File Inclusion (LFI)
Accessibility scope
Local
Impact
Denial of Service (DoS)
Affected component
filelock
Fixed by upgrading
Yes

Solution

Upgrade filelock to version 4.2.1 or newer.

Vulnerable code sample

import os
import tempfile
from filelock import ReadWriteLock

def acquire_shared_lock():
    # VULNERABLE: using a lock file in a world‑writable temp directory
    lock_path = os.path.join(tempfile.gettempdir(), "myapp.lock")
    rw_lock = ReadWriteLock(lock_path)
    with rw_lock.read_lock():
        # Placeholder for read‑only operation
        pass

Patched code sample

import os
import tempfile
from filelock import ReadWriteLock

def acquire_shared_lock():
    # FIX: place lock file in a private per‑user directory
    user_dir = os.path.join(tempfile.gettempdir(), f"myapp_{os.getuid()}")
    os.makedirs(user_dir, exist_ok=True)
    lock_path = os.path.join(user_dir, "myapp.lock")
    rw_lock = ReadWriteLock(lock_path)
    with rw_lock.read_lock():
        # Placeholder for read‑only operation
        pass

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(read-write):=20link=20privat?= (tox-dev/filelock)
    src/filelock/_api.py · BaseFileLock.__init__, src/filelock/_read_write.py, src/filelock/_read_write.py · _connect, src/filelock/_read_write.py · _remove_dead_links, src/filelock/_read_write.py · _remove_link_directory, src/filelock/_windows.py
  • =?UTF-8?q?=F0=9F=90=9B=20fix(read-write):=20keep=20SQLite?= (tox-dev/filelock)
    src/filelock/_read_write.py, src/filelock/_read_write.py · ReadWriteLock._configure_and_begin, src/filelock/_read_write.py · _connect, src/filelock/_read_write.py · _connect_through_descriptor, src/filelock/_read_write.py · _ForkSafeConnection.close, src/filelock/_read_write.py · _ForkSafeConnection.retain_until_close, src/filelock/_read_write.py · _link_beside, src/filelock/_read_write.py · _owner_is_gone, src/filelock/_read_write.py · _ProbeDescriptors.adopt, src/filelock/_read_write.py · _sweep_links_of_the_dead, src/filelock/_windows.py, tasks/capabilities.py and 1 more

Cite this entry

@misc{vaitp:cve2026112913,
  title        = {{SQLite file lock bypass via writable temp dir causing lock acquisition failures.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-112913},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-112913/}}
}

Download this entry as JSON Download the whole dataset

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

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.