CVE-2026-144381: CVE-2026-144381: Unintended Directory Permission Modification in Python filelock StrictSoftFileLock
CVE-2026-144381: Unintended Directory Permission Modification in Python filelock StrictSoftFileLock Vulnerability ID: CVE-2026-144381 CVSS Score: 3.6 Published: 2026-12-04 CVE-2026-144381 (GHSA-gqj6-5294-r46r) is a
CVE-2026-144381: Unintended Directory Permission Modification in Python filelock StrictSoftFileLock
Vulnerability ID: CVE-2026-144381
CVSS Score: 3.6
Published: 2026-12-04
CVE-2026-144381 (GHSA-gqj6-5294-r46r) is a local permission assignment and directory validation vulnerability in the Python filelock library prior to version 4.3.0. In Unix-like environments where a shared parent directory is writable by multiple users and lacks the sticky bit, an unprivileged local user can rename an unrelated directory owned by a victim account to match the filelock coordination path (.filelock). When the victim process subsequently invokes StrictSoftFileLock, the library verifies ownership of the directory via os.geteuid() and executes os.fchmod() to restrict its permissions without first validating that the directory contents conform to the lock protocol. This modifies the permission bits of the victim's directory and injects a claims subdirectory, resulting in unauthorized permission modifications and local denial of service.
TL;DR
Prior to version 4.3.0, Python's filelock library narrows permissions on any existing .filelock directory owned by the calling user before verifying its contents. In shared writable directories without the sticky bit, a local attacker can rename a victim's directory to the coordination path, causing StrictSoftFileLock to overwrite its permissions via fchmod and disrupt access.
⚠️ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-144381 (GHSA-gqj6-5294-r46r)
- Affected Component: filelock (StrictSoftFileLock in src/filelock/_strict.py)
- Vulnerability Class: CWE-732: Incorrect Permission Assignment for Critical Resource
- Attack Vector: Local (Shared writable parent directory lacking sticky bit)
- 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.24% (16.10th Percentile)
- Impact: Unintended directory chmod and structure modification leading to local DoS
- Patched Version: filelock >= 4.3.0
Affected Systems
- Python filelock (< 4.3.0) on Unix-like platforms (Linux, macOS, BSD)
-
filelock: < 4.3.0 (Fixed in:
4.3.0)
Code Analysis
Commit: f028e2b
Verify coordination and claims directory contents before calling os.fchmod in StrictSoftFileLock
Mitigation Strategies
- Upgrade the Python filelock library to version 4.3.0 or later to enforce directory content validation prior to permission modification.
- Set the POSIX sticky bit (+t / 0o1000) on all group-writable or world-writable shared directories to prevent unprivileged users from renaming directories owned by other accounts.
- Relocate lock files and coordination directories out of shared multi-user directories into dedicated directories with restrictive ownership and permissions (e.g., 0o700).
Remediation Steps:
- Identify all Python environments and application dependencies using filelock versions prior to 4.3.0.
- Update dependency manifests (requirements.txt, pyproject.toml) to require filelock>=4.3.0 and deploy updated packages.
- Audit filesystem permissions on directories where StrictSoftFileLock creates lock files and apply chmod +t to any directory writable by multiple users.
References
- NVD - CVE-2026-144381
- CVE.org Record - CVE-2026-144381
- GitHub Security Advisory GHSA-gqj6-5294-r46r
- GitHub Pull Request #978
- Fix Commit f028e2bea5e8c45c47b30a9c33ec38b015d5da22
- filelock 4.3.0 Release Tag
- CVE List v5 JSON Record
Read the full report for CVE-2026-144381 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.