Dec 5, 2026·10 min read·3 visits
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.
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.
The Python filelock library, maintained by the tox-dev organization, provides platform-independent file locking mechanisms used across build tools, package managers, and multi-process Python applications. In addition to standard OS-level file locks and basic soft locks, the library implements StrictSoftFileLock, a fail-closed locking mechanism designed to coordinate access via structured claim directories and metadata records. This protocol is used in environments where standard advisory locks are insufficient or where explicit claim state tracking is required across multiple cooperating processes.
When multiple local accounts on a Microsoft Windows host share access to a common working directory protected by StrictSoftFileLock, the claim directory (<lock-name>.filelock/claims/) becomes an exposed local attack surface. The protocol relies on creating temporary private records prior to publishing public lock claims. To maintain directory hygiene, lock contenders routinely inspect the claims directory during acquisition attempts and proactively unlink abandoned private records left behind by interrupted or crashed processes.
Classified under CWE-400 (Uncontrolled Resource Consumption), CVE-2026-144342 arises from an interaction between this proactive file reclamation routine and Windows NTFS opportunistic locking (oplock) behavior. An unprivileged local user who possesses only read access to the claims directory can request a read oplock on an abandoned private record. When a legitimate process subsequently attempts to acquire the lock and clean up the stale record, the synchronous deletion call blocks in the Windows kernel waiting for the reader to acknowledge an oplock break.
Because the stall occurs inside a synchronous Windows I/O manager operation during handle closure or deletion, the Python runtime cannot interrupt the call to enforce the caller's configured timeout parameter. Consequently, a low-privileged local reader can stall higher-privileged services or sibling applications attempting to acquire the lock, resulting in a localized denial of service.
Understanding the root cause requires examining the lifecycle of a lock claim under the StrictSoftFileLock protocol in src/filelock/_strict.py. When a contender attempts to acquire a strict lock, it does not write directly to the public claim path. Instead, it first creates a private temporary record matching the naming pattern .<lock-name>.private-v1-<random>.tmp or claims/.*.private-v1-<random>.tmp. Once the private record is populated and flushed to disk, the contender links or renames the private file into a public claim (*.claim).
If a process crashes, is forcibly terminated, or experiences an unhandled exception after creating the private record but before linking it to a public claim, the unlinked private file remains on the filesystem. To prevent the unbounded accumulation of orphaned files, StrictSoftFileLock scans the claim directory during subsequent lock acquisition operations and invokes _reclaim_private_record() on discovered private records. If a private record has a link count (st_nlink) of 1 and its modification time (st_mtime) is older than the configured grace period (private_record_grace = 2.0 seconds), the contender attempts to delete it via _unlink_private_record_once(), which calls os.unlink().
On POSIX filesystems, unlinking a file removes the directory entry immediately regardless of whether another process holds an open file descriptor to the underlying inode. On Windows NTFS filesystems, however, os.unlink() opens the target file with DELETE access and marks it for deletion upon handle closure. Furthermore, Windows allows any process with read permissions (FILE_GENERIC_READ) on a file to request an opportunistic lock (oplock) via FSCTL_REQUEST_OPLOCK.
When the lock claimant calls os.unlink() on an aged private record held under a read oplock by another local process, the Windows kernel detects an access conflict and initiates an oplock break transition. The kernel suspends the deleting thread until the oplock holder either closes its handle or acknowledges the break request. Because this wait takes place synchronously within the Windows I/O subsystem during the _unlink_private_record_once() call, control never returns to Python's user-space polling loop, rendering the timeout parameter in StrictSoftFileLock.acquire() ineffective.
The vulnerability resides in src/filelock/_strict.py within the _reclaim_private_record function and its helper _unlink_private_record_once. Prior to version 4.3.0, _reclaim_private_record verified that the target entry was a regular file, checked whether its link count was 1 and its age exceeded the 2.0-second grace window, and unconditionally invoked _unlink_private_record_once(directory_ref, private_name) across all operating systems.
# Vulnerable implementation in src/filelock/_strict.py (filelock <= 4.2.12)
def _unlink_private_record_once(
directory_ref: tuple[str, int | None], private_name: str
) -> None:
directory, directory_fd = directory_ref
if directory_fd is not None and _UNLINK_SUPPORTS_DIR_FD:
os.unlink(private_name, dir_fd=directory_fd)
else:
os.unlink(Path(directory, private_name)) # Blocks on Windows if reader holds oplock
def _reclaim_private_record(
directory_ref: tuple[str, int | None],
private_name: str,
now: Callable[[], float | None],
) -> None:
directory, _ = directory_ref
try:
private_stat = _lstat_relative(directory_ref, private_name)
except FileNotFoundError:
return
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:
# Unconditional deletion attempt on all platforms
_unlink_private_record_once(directory_ref, private_name)
except FileNotFoundError:
pass
except OSError as error:
if error.errno not in {EACCES, EPERM}:
raiseIn commit 856b39c59e8dd6c85ef381927b8a76d369c108e5 (PR #1045), maintainer Bernát Gábor remediated the flaw by restricting proactive private record unlinking to non-Windows platforms (if sys.platform != "win32":). Note that _reclaim_private_record still executes _lstat_relative and validates stat.S_ISREG(private_stat.st_mode) on Windows to preserve directory integrity checks against non-regular files, but bypasses the grace period calculation and the os.unlink() call entirely.
# Patched implementation in src/filelock/_strict.py (filelock 4.3.0)
if not stat.S_ISREG(private_stat.st_mode):
msg = f"{Path(directory, private_name)} is not a regular private record"
raise OSError(msg)
# 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> [!NOTE]
> Fix Completeness and Trade-offs: Skipping proactive reclamation on Windows completely eliminates the oplock stall vector during _reclaim_private_record. However, it introduces an operational trade-off: if processes frequently crash mid-acquisition on Windows, abandoned *.private-v1-*.tmp files will remain on disk rather than being automatically reaped after two seconds. Over extended periods with repeated process failures, this accumulation can increase directory traversal overhead until an administrator cleans up the stale files during a maintenance window.
Exploiting CVE-2026-144342 requires local code execution on a Windows machine and read access to a directory where another process or user coordinates work via StrictSoftFileLock. The attack also depends on a specific environmental precondition: a prior lock acquisition attempt must have terminated abnormally between creating its temporary private record and linking it into a public claim, leaving behind an unlinked .private-v1-*.tmp file older than two seconds (or alternatively, an abandoned .probe-v1-*.tmp timestamp probe file).
Once an aged private record exists in <lock-name>.filelock/claims/ (or as a hidden sentinel in the parent lock directory), the attacker opens a read handle to the file using the Win32 CreateFileW API with GENERIC_READ access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE sharing flags, and FILE_FLAG_OVERLAPPED. The attacker then issues an I/O control code FSCTL_REQUEST_OPLOCK via DeviceIoControl requesting a read-level opportunistic lock (OPLOCK_LEVEL_CACHE_READ or OPLOCK_LEVEL_CACHE_READ | OPLOCK_LEVEL_CACHE_HANDLE) with REQUEST_OPLOCK_INPUT_FLAG_REQUEST. Crucially, the attacker leaves the overlapped handle open and never processes or acknowledges kernel oplock break notifications.
When a victim process subsequently executes StrictSoftFileLock(lock_path, timeout=0) (or any finite timeout), the acquisition flow enumerates the claim directory, encounters the aged private file, and attempts to delete it. The upstream regression test test_strict_soft_private_record_oplock_keeps_deadline in tests/test_strict_soft.py demonstrates this exact condition:
@pytest.mark.skipif(os.name != "nt", reason="oplocks exist only on Windows")
def test_strict_soft_private_record_oplock_keeps_deadline(
tmp_path: Path, hold_oplock: OplockHolder
) -> None: # pragma: win32 cover
lock_path = tmp_path / "resource.lock"
with StrictSoftFileLock(lock_path):
pass
private = Path(f"{lock_path}.filelock") / "claims" / f".held-v1-{'0' * 32}.claim.private-v1-{'0' * 32}.tmp"
private.write_bytes(b"")
aged = time.time() - 3600
os.utime(private, (aged, aged))
entered: list[bool] = []
def acquire() -> None:
with StrictSoftFileLock(lock_path, timeout=0):
entered.append(True)
close_holder = hold_oplock(private, read_handle=True)
try:
finished, error = call_within(acquire, 2)
finally:
close_holder()
assert (finished, error, entered) == (True, None, [True])On vulnerable versions (<= 4.2.12), the acquire() call inside call_within(acquire, 2) fails to return within the 2-second test wrapper despite being configured with timeout=0 (non-blocking mode). Instead, the victim thread remains suspended in the Windows kernel until close_holder() explicitly closes the attacker's read handle.
The security impact of CVE-2026-144342 is confined to local availability degradation on Microsoft Windows systems. Because an attacker cannot read or modify protected application data through this mechanism, there is no direct impact on confidentiality or integrity. However, applications that rely on StrictSoftFileLock with bounded timeouts to ensure responsiveness or prevent worker thread starvation can be deadlocked indefinitely by an unprivileged local reader.
This risk is reflected in the CVSS v3.1 base score of 2.5 (Low) with vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L. The Attack Vector (AV:L) and Privileges Required (PR:L) metrics reflect the requirement for local execution and read permissions on the target directory. The Attack Complexity (AC:H) metric accounts for the precondition that an unlinked, aged private record must already exist on disk from a previously interrupted acquisition before a read-only user can attach an oplock to trigger the stall.
From a threat intelligence perspective, the vulnerability maps to MITRE ATT&CK technique T1499 (Endpoint Denial of Service) under the Impact (TA0040) tactic. Its Exploit Prediction Scoring System (EPSS) score is 0.00261 (19.05th percentile), indicating a very low likelihood of widespread exploitation in the wild. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no weaponized exploits exist outside of the official unit test suite.
The primary remediation for CVE-2026-144342 is to upgrade the filelock package to version 4.3.0 or later. Version 4.3.0 disables proactive unlinking of abandoned private records on win32 platforms, ensuring that lock contenders never open delete handles against stale private records during directory scans.
pip install --upgrade "filelock>=4.3.0"In addition to upgrading the package, system administrators and developers deploying applications on multi-user Windows hosts should harden the filesystem Access Control Lists (ACLs) governing lock directories. Specifically, the directory housing the .lock file and its corresponding <lock-name>.filelock/claims/ subdirectory should only grant FILE_GENERIC_READ and directory traversal permissions to the specific user accounts or service identities that legitimately participate in the locking protocol.
> [!WARNING]
> Operational Maintenance on Windows (filelock >= 4.3.0): Because version 4.3.0 leaves abandoned private records in place on Windows to prevent oplock stalls, environments that experience frequent unclean process terminations may accumulate orphaned temporary files over time.
To clean up accumulated stale records safely on Windows without risking lock inconsistency:
StrictSoftFileLock..<lock-name>.private-v1-*.tmp.<lock-name>.filelock/claims/, remove stale .*.private-v1-*.tmp and .probe-v1-*.tmp files.*.claim) remain from crashed processes, use the library's force_break() method programmatically rather than deleting active claims while contenders are running.CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
filelock tox-dev | < 4.3.0 (confirmed on 4.2.12) | 4.3.0 |
| Attribute | Detail |
|---|---|
| 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 |
The software does not properly control the allocation and maintenance of a limited resource, enabling an actor with read-only local access to consume thread execution time and block file handle operations indefinitely.
CVE-2026-144338 is a local denial-of-service vulnerability affecting the Python filelock library prior to version 4.3.0. On POSIX systems, when ReadWriteLock or AsyncReadWriteLock operates within a shared parent directory, an unprivileged local user can flood the directory with entries matching the .filelock-* prefix. Because connection initialization executes an unbounded synchronous directory sweep before evaluating user-supplied lock timeouts, this flooding stalls calling threads and starves the asyncio event loop.
CVE-2026-145370 (GHSA-7vw6-2xxx-fch6) is a resource allocation vulnerability in the Istio control plane (istiod). Prior to versions 1.30.9, 1.31.5, and 1.32.1, the JWKS resolver routine getRemoteContentWithRetry used an unbounded io.ReadAll call to retrieve remote JWKS and OpenID discovery documents. An authenticated Kubernetes user with permissions to create or modify a RequestAuthentication custom resource can specify an endpoint that returns an arbitrarily large or infinite stream, exhausting control-plane memory and placing istiod into a persistent CrashLoopBackOff state.
A cross-namespace isolation bypass vulnerability exists in the Istio control plane (istiod) affecting versions 1.30.0 through 1.30.8, 1.31.0 through 1.31.4, and 1.32.0. The strict gateway merging protection mechanism relies solely on user-modifiable Kubernetes resource annotations to identify internal configurations synthesized by the Kubernetes Gateway API controller. Because the admission validation webhook fails to block unprivileged users from specifying the internal.istio.io/gateway-semantics and internal.istio.io/service-account-name annotations on Istio Gateway custom resources, an attacker with permissions to create or update Gateway objects in a single tenant namespace can bypass namespace isolation. This allows the attacker to merge arbitrary listeners and host definitions into managed Gateway API proxy workloads operating in foreign namespaces.
CVE-2026-145372 is a denial of service vulnerability affecting the Istio service mesh control plane (istiod) across the 1.30.x, 1.31.x, and 1.32.x branches. When Kubernetes Gateway API support is explicitly disabled via the PILOT_ENABLE_GATEWAY_API=false flag, two distinct code paths in Pilot invoke methods on the uninitialized GatewayAPIController structure without checking for a nil receiver. An authenticated Kubernetes user with standard namespace-scoped permissions can trigger an unhandled Go runtime panic by applying the gateway.networking.k8s.io/gateway-name label to a sidecar-injected pod or creating an Istio Gateway custom resource containing a cross-namespace TLS secret reference. Because istiod continuously reconciles cluster state upon restart, the control plane enters a persistent CrashLoopBackOff state, halting mesh-wide xDS configuration distribution, mTLS certificate rotation, and admission webhook operations.
CVE-2026-145368 (GHSA-r567-vfff-9c27) is a NULL pointer dereference vulnerability (CWE-476) in the Istio service mesh control plane daemon (istiod). When an xDS client transmits a configuration rejection (NACK) containing an error_detail field for a resource type URL to which the gRPC stream was never subscribed, istiod invokes an internal resource update closure with a nil WatchedResource pointer. Both State-of-the-World (SotW) and Delta Aggregated Discovery Service (ADS) implementations unconditionally dereference this pointer, triggering an unhandled Go runtime panic that terminates the istiod process.
CVE-2026-145371 (GHSA-g435-phf9-7g5m) is a high-severity denial-of-service vulnerability affecting the Istio service mesh control plane (istiod). The flaw resides in the waypoint inbound cluster generation logic used by Istio Ambient mode (`pilot/pkg/networking/core/cluster_waypoint.go`). When an authenticated user with namespace-scoped permissions creates or modifies a `ServiceEntry` configured with `DNS` or `DNS_ROUND_ROBIN` resolution that resolves to zero endpoints, the internal `buildCluster` method returns a `nil` pointer. The calling function `buildWaypointInboundVIPCluster` fails to check for `nil` before dereferencing the returned structure, resulting in an unhandled runtime panic that terminates `istiod` and puts the entire mesh control plane into a continuous crash loop.