Skip to main content
Menu
Advisories

SoftReadWriteLock heartbeat overwrites victim-owned files after inode reuse

GHSA-X3F4-G3Q6-F985Published Updated GitHub

Description

Impact

A SoftReadWriteLock heartbeat can overwrite the beginning of an unrelated file with holder-record data. This requires a shared directory where another account can rename entries and a filesystem that reuses inode numbers. The overwrite was confirmed on ext4.

Affected versions and fix

The confirmed affected version is 4.2.12. Upgrade to filelock 4.3.0 or later. The heartbeat verifies the holder token on the open descriptor before writing. A mismatch marks the hold as lost. The fix does not protect a lock directory that another account can replace. PR #982

Workaround

Keep the lock and its records in a directory where only trusted accounts can rename entries.

Credits

Reported by OSS Scanner (ANT-2026-CC0VMGLC).

Affected versions

References

GitHub · tox-dev/filelock