filelock: SoftReadWriteLock heartbeat overwrites victim-owned files after inode reuseGHSA-x3f4-g3q6-f985
LOWFix: tox-dev/filelock@184931aGHSA-x3f4-g3q6-f985 is a low-severity (CVSS 2.5) CWE-367 vulnerability. A fix is available — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Description
filelock is a platform-independent file lock for Python. Prior to 4.3.0, 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. This issue is fixed in version 4.3.0.
Detection & mitigation playbook
VulnerabilityDetect
Identify every host running the affected component and compare the installed build against the fixed version below — for source-built or distro-packaged software the version string, not a lockfile, is the source of truth (`dpkg -l`, `rpm -q`, or the binary's own `--version`).
Fix
Upgrade the affected component to the fixed release for GHSA-x3f4-g3q6-f985, or apply your distribution's backported patch — distro builds are often patched at an older version number, so check your vendor's advisory rather than the upstream version alone.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This flaw is rated as Low severity because exploitation requires local access alongside a high-complexity race condition involving shared directory manipulation by an untrusted local user and inode recycling. Standard Red Hat product deployments typically execute Python workloads with restricted file permissions or…
To mitigate this vulnerability, ensure Python applications utilizing `filelock` create lock files within dedicated, user-private directories with restricted file permissions (e.g., directory mode 0700) rather than shared or world-writable locations such as `/tmp`. Where feasible, configure applications to avoid using `SoftReadWriteLock` heartbeats in multi-user shared directory environments. Caveats: Restricting lock file directories requires application path configuration and may require restarting affected application processes for environment variable or configuration changes to take effect.Source: Red Hat security advisory for GHSA-x3f4-g3q6-f985 (CC BY 4.0)
Frequently Asked Questions
Is GHSA-x3f4-g3q6-f985 in your dependencies?
Find it across your dependency tree, including transitive dependencies.