Description
filelock is a platform-independent file lock for Python. Prior to 4.2.1, UnixFileLock can truncate a regular file renamed onto the lock path when another local user has actual rename permission, or hard-linked there under a permissive hard-link policy; when an explicit mode is requested, affected versions from 3.10.2 can also change that file's mode. This issue is fixed in version 4.2.1.
Published: 2026-10-20
Score: 6.1 Medium
EPSS: n/a
KEV: No
Impact: File Truncation and Permission Modification
Action: Update to 4.2.1
AI Analysis

Impact

filelock is a platform-independent file lock for Python. Before version 4.2.1, the UnixFileLock implementation can truncate any regular file if a different local user with rename or hard‑link permission re‑names or hard‑links that file onto the lock path. When an explicit mode is requested, older releases also change the file’s permissions. This flaw allows a local attacker to destroy data and alter file permissions, potentially affecting confidentiality and integrity of the overwritten file. The weakness occurs due to improper handling of the lock path, identified as CWE-706.

Affected Systems

The vulnerability affects the tox‑dev filelock library in all releases prior to 4.2.1. Users that rely on earlier versions (including 3.10.2 through 4.2.0) and import UnixFileLock in environments where a local user can rename files or create hard links under a permissive policy are impacted. Versions 4.2.1 and later contain the fix and are not affected.

Risk and Exploitability

A local attacker with rename or hard‑link privileges can exploit this flaw by simply renaming or linking a target file onto the lock path. The attack is straightforward and does not require elevated privileges beyond those needed to perform the rename or link operation. The CVSS score of 6.1 indicates a moderate severity. EPSS information is not available, and the vulnerability is not listed in the CISA KEV catalog. Because the flaw is local and requires file‑system permissions typically granted to users with file ownership or broader privileges, the risk is confined to environments where such permissions exist. However, the impact—unintentional data loss and permission changes—can be critical in production settings where files are overwritten without awareness.

Generated by OpenCVE AI on October 20, 2026 at 16:57 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the filelock library to version 4.2.1 or higher, which fixes the truncation and chmod behavior.
  • If an upgrade is not immediately possible, restrict rename and hard‑link permissions on the directory containing the lock path so that only trusted processes can modify files there.
  • Ensure that the lock path is located in a secure, non‑world‑writable directory and consider using operating‑system level file locks or dedicated lock files to reduce the attack surface.

Generated by OpenCVE AI on October 20, 2026 at 16:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 20 Oct 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Tox-dev
Tox-dev filelock
Vendors & Products Tox-dev
Tox-dev filelock

Tue, 20 Oct 2026 14:30:00 +0000

Type Values Removed Values Added
Description filelock is a platform-independent file lock for Python. Prior to 4.2.1, UnixFileLock can truncate a regular file renamed onto the lock path when another local user has actual rename permission, or hard-linked there under a permissive hard-link policy; when an explicit mode is requested, affected versions from 3.10.2 can also change that file's mode. This issue is fixed in version 4.2.1.
Title filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path
Weaknesses CWE-706
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N'}


Subscriptions

Tox-dev Filelock
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-20T14:16:02.317Z

Reserved: 2026-10-19T20:16:09.857Z

Link: CVE-2026-112909

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-20T15:17:15.313

Modified: 2026-10-20T15:17:15.313

Link: CVE-2026-112909

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T17:00:18Z

Weaknesses
  • CWE-706

    Use of Incorrectly-Resolved Name or Reference