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.

Created at: Oct 26, 2026Updated at: Oct 26, 2026

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

Affected Package

Affecting filelock package, versions>=3.30.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