Time-of-check Time-of-use (TOCTOU) Race Condition Affecting filelock package, versions [4.2.12,4.3.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.2% (11th 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 Learn

Learn about Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-FILELOCK-23628772
  • published4 Dec 2026
  • disclosed3 Dec 2026
  • creditUnknown

Introduced: 3 Dec 2026

NewCVE-2026-144395  (opens in a new tab)
CWE-367  (opens in a new tab)

How to fix?

Upgrade filelock to version 4.3.0 or higher.

Overview

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition via the SQLite-backed ReadWriteLock implementation on POSIX systems, where another account with rename access in a shared, non-sticky lock directory can perform a directory swap to redirect the lock operation to a file writable by the locking process. This allows a cross-account overwrite of victim-owned files. The attack is confirmed on Linux.

Note: This is only exploitable when a shared, non-sticky lock directory is used and the attacker account has rename access within that directory, and a victim-owned directory that the other account could previously read is present.

CVSS Base Scores

version 4.0
version 3.1