Skip to main content
Vulnerability Database/CVE-2026-112915

CVE-2026-112915: Tox-dev Filelock DOS Vulnerability

CVE-2026-112915 is a denial of service vulnerability in Tox-dev Filelock that allows local users to cause lock acquisition stalls or hangs through crafted SQLite databases. This post covers technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112915 Overview

CVE-2026-112915 affects filelock, a platform-independent file lock library for Python maintained by tox-dev. The ReadWriteLock class opens a SQLite lock database without bounding schema and query work. A local user who can replace the database file can craft a malicious SQLite database that causes lock acquisition to stall or hang indefinitely. Versions from 3.20.4 expose the issue on initial per-instance opening, while versions from 3.30.0 repeat the exposure on every acquisition. The weakness is tracked as uncontrolled resource consumption [CWE-400]. The maintainers resolved the issue in version 4.2.1.

Critical Impact

A local attacker with write access to the lock database path can cause processes using filelock.ReadWriteLock to hang during acquisition, resulting in a denial of service for lock-dependent applications.

Affected Products

  • tox-dev filelock for Python, versions 3.20.4 through 4.2.0
  • Applications using filelock.ReadWriteLock with SQLite backend
  • Fixed in filelock version 4.2.1

Discovery Timeline

  • 2026-10-20 - CVE-2026-112915 published to NVD
  • 2026-10-21 - Last updated in NVD database

Technical Details for CVE-2026-112915

Vulnerability Analysis

The filelock library provides cross-platform file locking primitives for Python, including a ReadWriteLock implementation backed by SQLite. When ReadWriteLock opens its SQLite database, it performs schema loading and query execution without any upper bound on the work required. An attacker who can replace the database file supplies a crafted SQLite file whose schema or queries consume unbounded time or memory during the open or acquire path.

In versions from 3.20.4, the vulnerable code runs during the first per-instance opening of the database. Starting with version 3.30.0, the same unbounded work occurs on every acquisition, widening the exposure window and making repeated acquisition patterns reliably exploitable. The result is a hang or stall that outlasts any configured acquire timeout.

Root Cause

The root cause is missing resource bounds on SQLite schema parsing and query execution inside ReadWriteLock. The library trusted the on-disk database to be well-formed and small. Because the database path can be shared with other local accounts in common deployments, that trust was misplaced. The upstream fix in version 4.2.1 raises ValueError when a database schema exceeds a few kilobytes, and relocates the backing database to a directory that other local accounts cannot write to.

Attack Vector

Exploitation requires local access and the ability to replace or write to the SQLite lock database that ReadWriteLock uses. The attacker crafts a SQLite database with a schema or triggers designed to stall during open or query execution. When a victim process calls acquire() on the ReadWriteLock, the open or query path hangs, blocking the application. The attacker needs no network access and no interaction with the victim beyond planting the file.

text
+Fix :class:`~filelock.ReadWriteLock` acting on ``-journal``, ``-wal`` or ``-shm`` files another process puts beside its
+database: a write could land in another file, a reader could get in beside a writer, and an acquire could fail. SQLite
+now opens the database by name only in a directory no other account can write, and through a private hard link
+elsewhere. On Windows the directory's access control list decides. Where hard links are unavailable, keep the database
+in a directory other accounts cannot write, such as one under ``%LOCALAPPDATA%``. The lock removes link directories
+through a checked descriptor rather than by name, reads a link directory's name only when the locking account owns it,
+and leaves alone a directory with other content renamed onto a link directory's name. A database whose schema takes more
+than a few kilobytes to load raises :class:`ValueError` instead of running past the acquire timeout.

Source: filelock commit 5e3f2ec

Detection Methods for CVE-2026-112915

Indicators of Compromise

  • Python processes using filelock.ReadWriteLock that hang in SQLite open or query calls beyond the configured acquire timeout.
  • Unexpected SQLite database, -journal, -wal, or -shm files placed beside a ReadWriteLock path by non-owner accounts.
  • ValueError raised at acquisition after upgrading to 4.2.1, indicating an oversized schema planted at the lock path.

Detection Strategies

  • Inventory Python environments for installed filelock versions between 3.20.4 and 4.2.0 using pip list or SBOM data.
  • Audit application code for uses of filelock.ReadWriteLock and the on-disk paths it targets.
  • Monitor file integrity on directories hosting ReadWriteLock databases for writes from unexpected user accounts.

Monitoring Recommendations

  • Alert on long-running acquire() calls or elevated thread counts in Python services that use ReadWriteLock.
  • Log and review process stalls where sqlite3 appears in the stack during filelock operations.
  • Track ACL or permission changes on directories backing lock databases, especially under shared temporary paths.

How to Mitigate CVE-2026-112915

Immediate Actions Required

  • Upgrade filelock to version 4.2.1 or later across all Python environments and container images.
  • Move ReadWriteLock database paths out of world-writable directories to a location only the owning account can write to.
  • On Windows, place lock databases under %LOCALAPPDATA% or an equivalent ACL-restricted directory.
  • Rebuild and redeploy applications that pin older filelock releases through transitive dependencies.

Patch Information

The fix is available in filelock 4.2.1, delivered through pull request #834 and commit 5e3f2ec. The patch bounds schema loading to a few kilobytes, raises ValueError on oversized schemas, and opens the database through a private hard link in an ACL-restricted directory. See the GHSA-cwqr-hh33-gh44 advisory and the v4.2.1 release notes for details.

Workarounds

  • Relocate ReadWriteLock databases to a directory writable only by the service account, SYSTEM, and Administrators.
  • Restrict filesystem ACLs on directories hosting lock databases to block replacement by other local users.
  • Where upgrading is not immediate, avoid ReadWriteLock and use the standard FileLock class until 4.2.1 is deployed.
bash
# Upgrade filelock to the patched release
python -m pip install --upgrade 'filelock>=4.2.1'

# Verify installed version
python -c "import filelock; print(filelock.__version__)"

# Restrict directory ACLs on POSIX systems
chmod 700 /path/to/lock/dir
chown service-account:service-account /path/to/lock/dir

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.