Intel

AIKIDO-2026-867998

filelock is vulnerable to Race Condition (TOCTOU)

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jun 17, 2026
June 17, 2026

53

CVE Score

Medium

Race Condition (TOCTOU)

Are you affected? Scan for Free

TL;DR

When SoftFileLock or SoftReadWriteLock uses a writable shared lock directory, stale-lock breaking followed symlinks or stale mtimes and could delete a live lock or leave two holders active. A same-UID peer could also place a FIFO at a predictable read/write marker path to block lock operations indefinitely, and is_lock_held_by_us could treat another host's same-PID lock as owned locally. Attacker-controlled lock-file PIDs outside the valid range could prevent stale-lock recovery or abort acquisition with an uncaught error. The fix uses lstat, atomic rename-and-recheck breaking, non-blocking marker opens, hostname-aware holder checks, and strict PID range validation during self-heal.

How do I fix this?

Upgrade the filelock library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and use SoftFileLock or SoftReadWriteLock on a lock directory that untrusted local peers or other hosts can write to.

Package

Versions

3.22.0 - 3.29.1

Fixed in 3.29.2

Background info

filelock is vulnerable to Race Condition (TOCTOU) in versions 3.22.0 - 3.29.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea