PyPI: filelock

CVE-2026-112935

Safety vulnerability ID: SFTY-20261020-13394

Affected versions of the `filelock` package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition due to breaking a stale marker on the basis of an earlier observation that no longer holds. `SoftFileLock` judges a marker stale from a saved read and later removes the marker at that name, so a live successor created on a reused inode with a modification time no newer than the saved observation is mistaken for the stale one. A local attacker who frees its own marker right after the stale read can cause an honest contender's live marker to be removed, admitting two holders at once and defeating the mutual exclusion of the lock.

Created at: Oct 28, 2026Updated at: Oct 28, 2026

Overview

filelock: SoftFileLock stale-lock break removes a live lock file on a reused inode number and admits two holders

Advisory

filelock – Time-of-check Time-of-use (TOCTOU) Race Condition

Affected Package

Affecting filelock package, versions>=3.22.0,<=4.2.0

Also affects

---

How to Fix

Upgradefilelockto4.2.1or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more