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-112906 Overview
CVE-2026-112906 affects filelock, a platform-independent file locking library for Python. The vulnerability resides in SoftFileLock, MarkerSoftFileLock, and SoftFileLease classes between versions 4.1.0 and 4.2.0. An attacker with local access can trigger a race condition that causes a live lock holder's marker to be removed as stale. This breaks mutual exclusion guarantees and allows multiple processes to hold what should be an exclusive lock. The maintainers released a fix in version 4.2.1.
Critical Impact
Concurrent processes using SoftFileLock can simultaneously enter critical sections, corrupting shared state protected by the lock.
Affected Products
- filelock Python package versions 4.1.0 through 4.2.0
- Applications using SoftFileLock for coordination
- Applications using MarkerSoftFileLock or SoftFileLease
Discovery Timeline
- 2026-10-20 - CVE-2026-112906 published to the National Vulnerability Database (NVD)
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-112906
Vulnerability Analysis
The flaw is a stale-marker race condition classified under [CWE-694: Use of Multiple Resources with Duplicate Identifier]. SoftFileLock tracks ownership through a marker file on disk. The contender process checks the marker's observed state (inode and modification time) before declaring it stale and removing it.
When an attacker pre-dates and removes their own marker while two or more lock-user processes wait, the stale observation can be reused. Coarse filesystem modification time granularity, such as that on ext4 where freed inode numbers are reassigned to the next marker, preserves the attacker's observation across the window. An honest contender then creates a fresh marker on the reused inode, and the stale-break logic removes that live marker.
The result is loss of mutual exclusion. Code paths that assume serialized access through the lock can execute concurrently, corrupting data or violating invariants protected by the lock.
Root Cause
The root cause is identifying lock markers by inode number and modification time without an atomic exchange. Filesystems reuse freed inode numbers, and matching modification times across the check-and-break window let a prior observation remain valid after the marker it referenced was replaced.
Attack Vector
Exploitation requires local access and the ability to run a process that participates in the lock protocol. The attacker creates, pre-dates, and removes their own marker to seed a stale observation while at least two other processes wait on the lock. No authentication beyond local filesystem access is needed, but timing precision is required.
// Patch summary from docs/changelog/843.bugfix.rst (filelock 4.2.1)
Fix SoftFileLock, MarkerSoftFileLock and SoftFileLease removing or displacing
a live holder's marker in five cases:
1. ext4 gave a freed inode number to the next marker.
2. A stalled FileLock removed its ENOSYS placeholder after a peer replaced it.
3. A failed acquire cleaned up after a successor took the path.
4. A stale break left the lock path empty while it checked the marker it had moved.
5. A lifetime break judged a marker by a reused inode number.
On Linux and macOS a stale marker now changes hands in one atomic exchange.
On NFS, SMB, and other platforms without atomic exchange (except Windows),
the marker stays in place and waits for timeout or break_lock().
Source: GitHub Commit 740ff66
Detection Methods for CVE-2026-112906
Indicators of Compromise
- Multiple processes reporting successful acquisition of the same SoftFileLock path concurrently.
- Unexpected deletion or replacement of lock marker files owned by a live process.
- Corruption or inconsistency in files or state protected by a filelock-based mutex.
- Application logs showing lock holders being notified of a break event they did not request.
Detection Strategies
- Inventory Python dependencies and flag any filelock version from 4.1.0 up to and including 4.2.0.
- Instrument applications to log marker inode numbers and timestamps on acquire, release, and break operations.
- Audit filesystem events on known lock paths for rapid create-delete-recreate sequences from untrusted processes.
Monitoring Recommendations
- Monitor process execution for untrusted local users invoking Python code that touches shared lock directories.
- Alert on duplicate acquisition events for a single lock path within short time windows.
- Track filesystem telemetry on lock directories using endpoint detection and response (EDR) tooling to capture inode reuse patterns.
How to Mitigate CVE-2026-112906
Immediate Actions Required
- Upgrade filelock to version 4.2.1 or later across all Python environments.
- Identify every service and container image that pins a vulnerable filelock release and rebuild them.
- Restrict local access to directories hosting SoftFileLock markers to trusted service accounts only.
Patch Information
The fix is available in filelock 4.2.1, published in the GitHub Release v4.2.1. The underlying change is tracked in commit 740ff66 and documented in GHSA-2g95-wg33-c5x2. On Linux and macOS the patch replaces check-then-remove logic with a single atomic exchange. On NFS, SMB, and other platforms lacking atomic exchange, the marker stays in place until the timeout expires or break_lock() is invoked.
Workarounds
- Switch to FileLock instead of SoftFileLock where the host filesystem supports kernel-level advisory locks.
- Place lock directories on filesystems with high-resolution modification timestamps to reduce the exploit window.
- Restrict filesystem permissions on lock paths so only the owning service account can create or remove markers.
# Upgrade filelock to the patched release
pip install --upgrade 'filelock>=4.2.1'
# Verify installed version
python -c "import filelock; print(filelock.__version__)"
# Restrict lock directory permissions to the service account
chown service-user:service-group /var/lib/myapp/locks
chmod 700 /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

