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:
- Audit application dependencies and virtual environments for filelock versions prior to 4.3.0 where StrictSoftFileLock is used on Windows.
- Run
pip install --upgrade "filelock>=4.3.0"and update pinned dependency manifests (requirements.txt, poetry.lock, uv.lock). - Verify NTFS permissions on shared lock directories using
icaclsto ensure low-privileged users without a need to acquire the lock cannot read claim files. - During scheduled maintenance windows with all contenders stopped, purge residual
.<lock-name>.private-v1-*.tmp,.*.private-v1-*.tmp, and.probe-v1-*.tmprecords.
References
- GitHub Security Advisory: GHSA-jcqr-c9r9-vgjh
- GitHub Pull Request #1045: fix(strict): skip Windows private reclaim
- GitHub Fix Commit 856b39c59e8dd6c85ef381927b8a76d369c108e5
- filelock Release 4.3.0
- CVE.org Record: CVE-2026-144342
- National Vulnerability Database (NVD): CVE-2026-144342
- MITRE ATT&CK Search Reference
- CVE Project cvelistV5 Raw JSON Record
Read the full report for CVE-2026-144342 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.