Race Condition Enabling Link Following Affecting filelock package, versions [4.1.0,4.2.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.1% (1st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-FILELOCK-21280757
  • published20 Oct 2026
  • disclosed20 Oct 2026
  • creditAnthropic's OSS Scanner

Introduced: 20 Oct 2026

NewCVE-2026-112914  (opens in a new tab)
CWE-363  (opens in a new tab)

How to fix?

Upgrade filelock to version 4.2.1 or higher.

Overview

Affected versions of this package are vulnerable to Race Condition Enabling Link Following via SoftFileLock._try_break_stale_lock in src/filelock/_soft.py, which can restore a stale marker by name after moving it aside. A local attacker with rename access in a non-sticky lock directory can swap in a symbolic link, causing the lock user to hard-link one of its own files into the lock directory on a runtime that follows the link and a same-filesystem target. This allows the attacker to break a live lock and achieve unauthorized write access to files owned by the victim process.

Note: This is only exploitable when another local user has rename access in a non-sticky lock directory, and no other user can replace the lock directory or any of its ancestors.

CVSS Base Scores

version 4.0
version 3.1