---
id: "CVE-2026-112909"
kind: "vulnerability"
aliases: ["CVE-2026-112909"]
title: "filelock: Unix lock path can truncate or re-mode a local file"
severity: "medium"
cvss: 6.1
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "python", "shared-hosts", "unix"]
not_affected_if: ["private-lock-directory", "windows-only"]
published_at: "2026-10-20T15:17:15+00:00"
first_seen_at: "2026-10-23T21:57:20+00:00"
updated_at: "2026-10-25T04:04:10+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112909", "first_seen_at": "2026-10-23T21:57:20+00:00"}]
---

# filelock: Unix lock path can truncate or re-mode a local file

filelock's UnixFileLock can truncate a regular file that another local user renamed or hard-linked onto the lock path before 4.2.1. When an explicit mode is requested, affected versions from 3.10.2 can also change that file's permissions.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `pip show filelock` or `python -c "import filelock; print(filelock.__version__)"` and compare against `4.2.1`
- Check whether lock paths sit in shared, world-writable directories such as /tmp where other local users can rename files

## Fix

- Upgrade the `filelock` Python package to `4.2.1` or later
- Keep lock files in directories only the service user can write to

## Timeline

- 2026-10-23T21:57:20+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-112909

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
