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-112936 Overview
CVE-2026-112936 affects filelock, a platform-independent file locking library for Python maintained by tox-dev. The ReadWriteLock and AsyncReadWriteLock classes introduced in version 3.20.4 resolve the lock path and pass it to SQLite without rejecting a final symbolic link. A local user with write access to the lock directory can plant a symlink to redirect SQLite database creation and locking to an attacker-chosen path. This can split mutual exclusion across targets or corrupt files outside the intended lock directory. The issue is tracked under [CWE-59: Link Following] and is resolved in filelock 4.0.9.
Critical Impact
A local user with access to the shared lock directory can redirect filelock's SQLite database writes to arbitrary paths, breaking mutual exclusion guarantees between processes.
Affected Products
- tox-dev filelock versions 3.20.4 through 4.0.8
- Python applications using ReadWriteLock
- Python applications using AsyncReadWriteLock
Discovery Timeline
- 2026-10-20 - CVE-2026-112936 published to NVD
- 2026-10-21 - Last updated in NVD database
Technical Details for CVE-2026-112936
Vulnerability Analysis
The ReadWriteLock and AsyncReadWriteLock classes use SQLite as a coordination backend. When initializing a lock, the implementation resolves the user-supplied lock path and passes it directly to SQLite's open routine without verifying whether the final path component is a symbolic link. If the resolved path is a symlink planted by another local user in a world-writable or shared directory, SQLite opens and locks the symlink target instead of the intended file.
This breaks the mutual exclusion contract the library is designed to enforce. Two cooperating processes may believe they share a lock while SQLite operates on different underlying files, producing split-brain conditions in which both processes acquire write access simultaneously. An attacker can also redirect database creation to overwrite or corrupt files the victim process can write to.
Root Cause
The lock-path resolution code in ReadWriteLock does not use O_NOFOLLOW semantics or an equivalent symlink rejection check on the final path component before handing the path to SQLite. SQLite itself follows symlinks transparently, so any link planted after path validation but before open is honored. This is a classic link-following flaw [CWE-59] in a trust-sensitive synchronization primitive.
Attack Vector
Exploitation requires a local, authenticated user who can create filenames in the directory where another user or service places filelock lock files. The attacker creates a symbolic link at the expected lock-file name pointing to an arbitrary target path writable by the victim process. When the victim initializes a ReadWriteLock, SQLite opens the symlink target and applies its lock there, redirecting coordination off the intended file.
The patch from commit 4d45e83caf7e31f9a12fb44526bdc07f70114f04 documents the fix behavior:
:class:`ReadWriteLock <filelock.ReadWriteLock>` refuses a symlink at its database path and keeps SQLite on the file it
checked, so a link planted in a shared directory cannot point the lock at another file.
Source: tox-dev/filelock commit 4d45e83
Detection Methods for CVE-2026-112936
Indicators of Compromise
- Symbolic links present in directories used for filelock SQLite coordination files, where links point outside the lock directory.
- Unexpected modification timestamps or ownership on files targeted by resolved lock paths.
- Application logs showing concurrent write access from processes that should have been serialized by a ReadWriteLock.
Detection Strategies
- Audit Python dependency manifests (requirements.txt, pyproject.toml, poetry.lock) for filelock versions between 3.20.4 and 4.0.8.
- Scan filesystem paths used by applications for symbolic links in directories hosting filelock SQLite databases.
- Review process telemetry for calls to sqlite3_open or open() originating from the filelock package that resolve to paths outside the configured lock directory.
Monitoring Recommendations
- Monitor shared and world-writable directories for symlink() or ln -s operations by non-owning users.
- Enable Linux audit rules on lock directories to capture creat, symlinkat, and openat syscalls targeting lock filenames.
- Alert on unexpected process pairs holding simultaneous write locks on resources intended to be mutually exclusive.
How to Mitigate CVE-2026-112936
Immediate Actions Required
- Upgrade filelock to version 4.0.9 or later in all Python environments.
- Audit code paths that instantiate ReadWriteLock or AsyncReadWriteLock and verify lock directories are not writable by untrusted local users.
- Remove any symbolic links discovered in filelock coordination directories pending investigation.
Patch Information
The fix is included in filelock 4.0.9. The library now refuses a symlink at the database path and keeps SQLite bound to the file it validated. See the GitHub Security Advisory GHSA-j8f7-rjxc-mr56 and the filelock 4.0.9 release notes for the full remediation details.
Workarounds
- Place filelock SQLite coordination files in a directory owned by the application user with mode 0700 to prevent other local users from creating entries.
- Substitute UnixFileLock or WindowsFileLock for ReadWriteLock on platforms where read-write semantics are not strictly required.
- Restrict local shell and filesystem access to multi-tenant hosts running affected applications until patching is complete.
# Upgrade filelock to the patched version
pip install --upgrade 'filelock>=4.0.9'
# Harden the lock directory against symlink planting
chown app_user:app_group /var/lib/myapp/locks
chmod 0700 /var/lib/myapp/locks
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

