Time-of-check Time-of-use (TOCTOU) Race Condition 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 Learn

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

Start learning
  • Snyk IDSNYK-PYTHON-FILELOCK-21280751
  • published20 Oct 2026
  • disclosed20 Oct 2026
  • creditAnthropic's OSS Scanner

Introduced: 20 Oct 2026

NewCVE-2026-112941  (opens in a new tab)
CWE-367  (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 Time-of-check Time-of-use (TOCTOU) Race Condition via the strict lock implementation in _strict.py and related soft read-write storage code, where claim directories are created without being restricted to the owning account. A local attacker who can write to the same filesystem path can interfere with or substitute the claim directory, allowing unauthorized modification of lock state.

CVSS Base Scores

version 4.0
version 3.1