CVE-2026-112935
Medium · 4.7CVSS
4.7
EPSS
0.1%
Published
Oct 20, 2026
CISA due date
—
Cloudanix analysis
A Python library used to prevent two programs from editing the same file at once can fail under certain timing conditions, allowing both programs to proceed and potentially damage data.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- High
- Impact
- Data Tampering
- Component
- Library
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
SoftFileLock in filelock 3.22.0-4.2.0 permits a race where an attacker can delete its own stale lock marker after the honest process has read it but before it can validate the successor marker's timestamp, allowing two processes to hold the lock simultaneously on the same inode.
Why it matters to the business
Applications relying on file-based locking for exclusive access may experience data corruption or inconsistent state when multiple processes write to the same resource at once, increasing operational risk for any Python software using the library until upgraded.
How an attack unfolds
An attacker with local access observes or forces creation of a stale lock file, releases their marker after the victim reads it, then races to create a new lock whose mtime is not strictly newer than the victim's saved observation, tricking the victim into removing the live lock and allowing concurrent access.
How to fix it
Upgrade filelock to version 4.2.1 or later for all affected installations; until then, switch to the platform-native FileLock implementation or add external synchronization.
How to confirm the fix worked
Confirm filelock >= 4.2.1 is installed via pip show or package metadata; run the library's regression tests for SoftFileLock under concurrent load; monitor for duplicate lock acquisitions in application logs.
Typical attack path
- Identify Python process using filelock SoftFileLock on a shared path
- Create or wait for a stale lock marker on the target inode
- Release attacker marker after victim reads the stale state
- Immediately acquire a new lock whose mtime satisfies the victim's timestamp check
- Trigger the victim to delete the new lock marker, resulting in dual holders
How to detect it
Review application and system logs for concurrent write attempts or lock-acquisition failures around the affected library; look for processes holding duplicate file locks on the same path via lsof or equivalent tooling.
What your security team should do
- Immediately inventory all Python environments for filelock versions < 4.2.1
- Prioritize upgrade to 4.2.1 in high-concurrency or data-integrity sensitive workloads
- Temporarily replace SoftFileLock usage with FileLock or external locking primitives
- Add dependency pinning and automated scanning to prevent regression
The record
filelock is a platform-independent file lock for Python. From 3.22.0 until 4.2.1, SoftFileLock can break a stale marker after an attacker frees its own marker following the stale read, an honest contender creates a live successor on the reused inode, and the successor's modification time is not newer than the saved observation, causing the live marker to be removed and two holders to be admitted. This issue is fixed in version 4.2.1.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-116250 In server mode pgAdmin 4 validates a path a user gives for a file in their storage… CWE-367
- CVE-2026-116240 In server mode pgAdmin 4 validates a path into the user's storage directory with… CWE-367
- CVE-2026-115683 A race condition in Epiphany allows a malicious website to bypass the TLS/SSL certificate… CWE-367
- CVE-2026-119552 Uptime Kuma through 2.5.8 contains a race condition in the Socket.IO first-run setup… CWE-367
- CVE-2026-92374 A time-of-check time-of-use (TOCTOU) race condition combined with improper symbolic link… CWE-367
- CVE-2026-117603 Electrum before 4.7.2 contains a spending limit bypass vulnerability in the Nostr Wallet… CWE-367
- CVE-2026-75524 OpenReception's appointment booking software provides an end-to-end encrypted appointment… CWE-367
- CVE-2026-105481 A flaw in Node.js HTTP Agent connection reuse can cause a client to accept as valid a… CWE-367