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.
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
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261020-13394/CVE-2026-112935
- https://github.com/tox-dev/filelock/security/advisories/GHSA-fq56-3cx3-fjxp
- https://nvd.nist.gov/vuln/detail/CVE-2026-112935
- https://github.com/tox-dev/filelock/pull/843
- https://github.com/tox-dev/filelock/commit/740ff666b62a88496c8d7394e4e6230605e4d62b
- https://github.com/tox-dev/filelock/releases/tag/4.2.1
- https://github.com/advisories/GHSA-fq56-3cx3-fjxp
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
