PyPI: filelock
CVE-2026-112909
Safety vulnerability ID: SFTY-20261020-81101
Affected versions of the `filelock` package are vulnerable to Link Following due to truncating, and with an explicit `mode` also changing the permissions of, whatever regular file is found at the lock path, whether or not the acquire created it. `UnixFileLock`, the backend of `FileLock` and `AsyncFileLock` on Unix, empties the file at the lock path once it holds the lock, and the `O_NOFOLLOW` defence added for CVE-2025-68146 does not see a renamed file or a hard link. A local attacker who can rename or hard-link one of the lock user's files onto the lock path gets that file truncated by the next `acquire()`, and with a mode such as `0o666` gains read and write access to it.
Overview
filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path
Advisory
filelock – Link Following
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261020-81101/CVE-2026-112909
- https://github.com/tox-dev/filelock/security/advisories/GHSA-69hj-f68j-2879
- https://nvd.nist.gov/vuln/detail/CVE-2026-112909
- https://github.com/tox-dev/filelock/pull/835
- https://github.com/tox-dev/filelock/commit/e1e825b1992f69fb6b346dc395d5ae4893536c0a
- https://github.com/tox-dev/filelock/releases/tag/4.2.1
- https://github.com/advisories/GHSA-69hj-f68j-2879
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
