PyPI: filelock
CVE-2026-112938
Safety vulnerability ID: SFTY-20261017-57659
Affected versions of the `filelock` package are vulnerable to Race Condition Enabling Link Following due to checking `<path>.filelock` once with `lstat` and then reaching `<path>.filelock/claims` by pathname. `StrictSoftFileLock` and `AsyncStrictSoftFileLock` pass `O_NOFOLLOW` only for the final `claims` component, so the kernel follows a symbolic link swapped in for `<path>.filelock` after the check. A local attacker who can rename that directory makes the lock user's process create claim directories and files in a directory the attacker chooses, which can leave another strict lock timing out for every process until an operator force-breaks each stranded claim.
Overview
filelock: StrictSoftFileLock follows a symbolic link swapped in at <path>.filelock and creates claim files in a directory another local user chooses
Advisory
filelock – Race Condition Enabling Link Following
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261017-57659/CVE-2026-112938
- https://github.com/tox-dev/filelock/security/advisories/GHSA-m462-7rxw-wvpg
- https://github.com/tox-dev/filelock/pull/839
- https://github.com/tox-dev/filelock/commit/bfa066d65a1ba9106f86ee9d027f7588b9c77e03
- https://github.com/tox-dev/filelock/releases/tag/4.2.1
- https://github.com/advisories/GHSA-m462-7rxw-wvpg
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
