Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

CVE-2026-144342: CVE-2026-144342: Windows Opportunistic Lock Denial of Service in Python filelock StrictSoftFileLock

CVE-2026-144342: Windows Opportunistic Lock Denial of Service in Python filelock StrictSoftFileLock Vulnerability ID: CVE-2026-144342 CVSS Score: 2.5 Published: 2026-12-04 CVE-2026-144342 (GHSA-jcqr-c9r9-vgjh) is an

CVE-2026-144342: Windows Opportunistic Lock Denial of Service in Python filelock StrictSoftFileLock

Vulnerability ID: CVE-2026-144342
CVSS Score: 2.5
Published: 2026-12-04

CVE-2026-144342 (GHSA-jcqr-c9r9-vgjh) is an uncontrolled resource consumption vulnerability in the Python filelock package affecting Windows environments. When applications utilize the StrictSoftFileLock locking protocol in directories shared across multiple local accounts, a low-privileged user with read-only access can exploit Windows NTFS opportunistic locking (oplock) semantics on aged, abandoned private claim records. By holding an unacknowledged read oplock on a stale temporary file, an attacker forces subsequent lock claimants attempting to unlink the record during directory reclamation scans into an indefinite kernel-level I/O wait, bypassing configured acquisition timeout limits.

TL;DR

A local user with read access to a shared StrictSoftFileLock claims directory on Windows can hold an opportunistic lock on an abandoned temporary claim file, causing subsequent lock acquisition attempts to block indefinitely inside os.unlink() regardless of configured Python timeouts. Upgrade filelock to version 4.3.0 to remediate the issue.

⚠️ Exploit Status: POC

Technical Details

  • CVE / GHSA ID: CVE-2026-144342 / GHSA-jcqr-c9r9-vgjh
  • Weakness Class: CWE-400 (Uncontrolled Resource Consumption)
  • CVSS v3.1 Score: 2.5 Low (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L)
  • Affected Component: PyPI filelock (< 4.3.0) StrictSoftFileLock on Windows
  • Attack Vector: Local read-only opportunistic lock (oplock) on stale private claim records
  • Security Impact: Local Denial of Service (indefinite lock acquisition stall bypassing timeout)
  • EPSS Score: 0.00261 (19.05th percentile)
  • Patched Version: filelock 4.3.0

Affected Systems

  • Python filelock package (< 4.3.0) running on Microsoft Windows utilizing StrictSoftFileLock
  • filelock: < 4.3.0 (confirmed on 4.2.12) (Fixed in: 4.3.0)

Code Analysis

Commit: 856b39c

fix(strict): skip Windows private reclaim (#1045)

--- a/src/filelock/_strict.py
+++ b/src/filelock/_strict.py
@@ -613,18 +615,20 @@ def _reclaim_private_record(
     if not stat.S_ISREG(private_stat.st_mode):
         msg = f"{Path(directory, private_name)} is not a regular private record"
         raise OSError(msg)
-    private_record_grace: Final[float] = 2.0
-    if private_stat.st_nlink == 1 and (
-        (current := now()) is None or current - private_stat.st_mtime < private_record_grace
-    ):
-        return
-    try:
-        _unlink_private_record_once(directory_ref, private_name)
-    except FileNotFoundError:
-        pass
-    except OSError as error:
-        if error.errno not in {EACCES, EPERM}:
-            raise
+    # Closing a delete handle can wait indefinitely for another process's read-handle oplock.
+    if sys.platform != "win32":  # pragma: win32 no cover
+        private_record_grace: Final[float] = 2.0
+        if private_stat.st_nlink == 1 and (
+            (current := now()) is None or current - private_stat.st_mtime < private_record_grace
+        ):
+            return
+        try:
+            _unlink_private_record_once(directory_ref, private_name)
+        except FileNotFoundError:
+            pass
+        except OSError as error:
+            if error.errno not in {EACCES, EPERM}:
+                raise

Exploit Details

  • GitHub: Official upstream regression test (test_strict_soft_private_record_oplock_keeps_deadline) demonstrating the Windows oplock stall condition.

Mitigation Strategies

  • Upgrade the Python filelock dependency to version 4.3.0 or higher across all Windows deployments.
  • Restrict Windows NTFS Access Control Lists (ACLs) on lock directories and .filelock/claims/ subdirectories so untrusted local accounts lack read and list permissions.
  • Implement periodic offline maintenance procedures to remove orphaned .private-v1-.tmp and .probe-v1-.tmp files when all lock contenders are stopped.

Remediation Steps:

  1. Audit application dependencies and virtual environments for filelock versions prior to 4.3.0 where StrictSoftFileLock is used on Windows.
  2. Run pip install --upgrade "filelock>=4.3.0" and update pinned dependency manifests (requirements.txt, poetry.lock, uv.lock).
  3. Verify NTFS permissions on shared lock directories using icacls to ensure low-privileged users without a need to acquire the lock cannot read claim files.
  4. During scheduled maintenance windows with all contenders stopped, purge residual .<lock-name>.private-v1-*.tmp, .*.private-v1-*.tmp, and .probe-v1-*.tmp records.

References

Read the full report for CVE-2026-144342 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.