# GHSA-22WC-J8C9-7GXG: ReadWriteLock can overwrite victim-owned files through a directory swap

- Database: GitHub
- Severity: CVSS 4.4 (Medium)
- Published: 2026-11-22
- Modified: 2026-12-03

## Tracked as

- [CVE-2026-144395](https://cve.now/CVE-2026-144395.md): filelock: ReadWriteLock can overwrite victim-owned files through a directory swap

## Affected versions

- filelock (PyPI): 4.2.12

## Description

## Impact

On POSIX, another account with rename access in a shared, non-sticky lock directory can redirect a SQLite-backed `ReadWriteLock` operation to a file writable by the locking process. A cross-account overwrite was confirmed on Linux. The affected setup also required a victim-owned directory that the other account could previously read.

## Affected version and mitigation

The confirmed affected release is filelock 4.2.12. Upgrade to 4.3.0 or later.

Filelock now creates the final database link inside a fresh owner-only directory, verifies its permissions and requires the link to exist when SQLite opens it. Upgrade every process sharing the database before resuming operations. Until then, keep its parent writable only by the locking account or use a sticky shared parent. [Fix in PR #1096](https://github.com/tox-dev/filelock/pull/1096).

## Credits

OSS Scanner: ANT-2026-XYOWG885.

## References

- https://github.com/tox-dev/filelock/security/advisories/GHSA-22wc-j8c9-7gxg

Page: https://cve.now/GHSA-22WC-J8C9-7GXG

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
