CVE-2026-144382: CVE-2026-144382: Unverified Ownership and Lock Bypass via Linux Overflow UID in Python filelock
CVE-2026-144382: Unverified Ownership and Lock Bypass via Linux Overflow UID in Python filelock Vulnerability ID: CVE-2026-144382 CVSS Score: 3.6 Published: 2026-12-04 CVE-2026-144382 (GHSA-7mx6-8qvh-pvc4) is an unv
CVE-2026-144382: Unverified Ownership and Lock Bypass via Linux Overflow UID in Python filelock
Vulnerability ID: CVE-2026-144382
CVSS Score: 3.6
Published: 2026-12-04
CVE-2026-144382 (GHSA-7mx6-8qvh-pvc4) is an unverified ownership vulnerability (CWE-283) in the tox-dev/filelock Python library prior to version 4.3.0. On Linux systems utilizing user namespaces or idmapped mounts, unmapped user identifiers are reported by the kernel as the overflow UID (typically 65534). When lock coordination directories or files reside within a shared sticky directory such as /tmp, filelock's ownership verification fails to distinguish between unrelated host accounts that resolve to the same overflow UID. This allows a local attacker to plant a lock protocol tree that is trusted by victim processes, breaking mutual exclusion guarantees in SoftReadWriteLock, StrictSoftFileLock, and UnixFileLock.
TL;DR
Prior to version 4.3.0, the Python filelock library trusts file ownership matches on the Linux kernel overflow UID (65534) inside sticky directories like /tmp. Unrelated accounts across user namespaces or idmapped mounts can pre-create lock protocol directories that victim processes treat as their own, allowing attackers to bypass mutual exclusion and admit readers while a writer holds the lock.
Technical Details
- CVE / GHSA ID: CVE-2026-144382 / GHSA-7mx6-8qvh-pvc4
- Weakness Class: CWE-283: Unverified Ownership
- CVSS v3.1 Score: 3.6 Low (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L)
- EPSS Score: 0.19% (8.69th Percentile)
- Affected Component: filelock._util.foreign_owner (SoftReadWriteLock, StrictSoftFileLock, UnixFileLock)
- Patched Version: filelock 4.3.0 (Commit 54e61ea35b50a067274d6a04300dad86b341cc5a)
- Exploit & KEV Status: No public PoC / Not in CISA KEV
Affected Systems
- tox-dev/filelock (PyPI package: filelock) on Linux and Android platforms
-
filelock: < 4.3.0 (Fixed in:
4.3.0)
Code Analysis
Commit: 54e61ea
Under a sticky parent such as /tmp, refuse a lock file or protocol directory reported with Linux's overflow UID.
diff --git a/src/filelock/_util.py b/src/filelock/_util.py
index 97da72d8d..c2e6f4148 100644
--- a/src/filelock/_util.py
+++ b/src/filelock/_util.py
@@ -353,12 +353,25 @@ def foreign_owner(node: os.stat_result, parent: os.stat_result) -> int | None:
# :param node: ``lstat`` or ``fstat`` of the file or directory found in place.
# :param parent: ``stat`` of the directory that holds it.
#
+ # Unmapped accounts in a Linux user namespace or idmapped mount share one reported uid.
+ #
# :returns: the owning uid when another account controls the node, otherwise ``None``.
if sys.platform != "win32" and parent.st_mode & stat.S_ISVTX: # pragma: needs foreign-sticky-tmp
- return None if node.st_uid in {os.geteuid(), parent.st_uid} else node.st_uid
+ owner = node.st_uid
+ return None if owner in {os.geteuid(), parent.st_uid} and not _ambiguous_owner(owner) else owner
return None
+def _ambiguous_owner(uid: int) -> bool: # pragma: win32 no cover # pragma: darwin no cover
+ if sys.platform not in {"linux", "android"}: # pragma: linux no cover # pragma: android no cover
+ return False
+ try:
+ return uid == int(Path("/proc/sys/kernel/overflowuid").read_text(encoding="ascii"))
+ except (OSError, ValueError):
+ # Without the configured overflow UID, equality from stat cannot prove ownership.
+ return True
Mitigation Strategies
- Upgrade the Python filelock library to version 4.3.0 or later across all virtual environments, container images, and dependency lockfiles.
- Relocate lock files out of shared world-writable sticky directories (/tmp, /var/tmp) into dedicated, private directories with strict permissions (0700).
- Avoid sharing host /tmp directories across untrusted Linux user namespaces or unmapped container mounts; provide each container or namespace with an isolated tmpfs mount at /tmp.
- Configure explicit UID mappings in user namespaces and idmapped mounts for accounts that must share lock directories across namespace boundaries so they do not collapse to the kernel overflow UID (65534).
Remediation Steps:
- Identify all Python projects and container images using filelock prior to version 4.3.0 via
pip listor software composition analysis (SCA) tooling. - Update dependency specifications (requirements.txt, pyproject.toml, poetry.lock, Pipfile.lock) to require
filelock>=4.3.0and redeploy affected workloads. - Audit application code for hardcoded lock paths inside
/tmportempfile.gettempdir()when usingUnixFileLock,StrictSoftFileLock, orSoftReadWriteLock. - Where workloads execute under UID 65534 (nobody) or without
/procmounted, migrate lock paths to a non-sticky private directory so the new fail-closed overflow UID check in 4.3.0 does not reject legitimate locks.
References
- GitHub Security Advisory: GHSA-7mx6-8qvh-pvc4
- GitHub Pull Request #977: Refuse overflow UID under sticky directory
- filelock 4.3.0 Release Tag
- NVD Vulnerability Detail: CVE-2026-144382
- CVE.org Record: CVE-2026-144382
- CVEListV5 Official JSON Record for CVE-2026-144382
- Shodan CVEDB Entry: CVE-2026-144382
Read the full report for CVE-2026-144382 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.