CVE-2026-112937: filelock: ReadWriteLock on the hard-link route deletes any directory another user renames onto its .filelock-* link directory name
ReadWriteLock and AsyncReadWriteLock (the SQLite-backed reader/writer lock) remove their private .filelock-* link directories with shutil.rmtree (a recursive delete) on a remembered path. They do not check that the path still names the directory they created. This happens on the hard-link route (a hard link is a second name for the same file). That route is every connection on macOS since 4.1.1 and any POSIX process without a usable /proc/self/fd (a Linux path that names the process’s own open files), such as a chroot or container that does not mount /proc.
Another local user who can rename entries in the directory that holds the lock database can rename one of the directories of the user running the lock (below: the lock user) onto the link directory’s name, or onto a forged dead-holder name. Such a lock directory is a 0777 or group-writable cache, build or project directory without the sticky bit (a directory flag that lets only a file’s owner remove or rename it). The lock user’s process then deletes that tree and everything in it with the lock user’s permissions, and reports no error. Stock Linux with /proc mounted is not affected. Affected versions are filelock 4.1.0 through 4.2.0.
Anthropic’s OSS Scanner reported this in private as ANT-2026-LSSZIUEO [high, CWE-367]: ReadWriteLock deletes any directory another user renames to .filelock-*.
References
- github.com/advisories/GHSA-jqc4-5cvw-7w85
- github.com/tox-dev/filelock/commit/5e3f2ec0c5fb17cb2635b60b2b68bc63ab81ca2d
- github.com/tox-dev/filelock/pull/834
- github.com/tox-dev/filelock/releases/tag/4.2.1
- github.com/tox-dev/filelock/security/advisories/GHSA-jqc4-5cvw-7w85
- nvd.nist.gov/vuln/detail/CVE-2026-112937
Code Behaviors & Features
Detect and mitigate CVE-2026-112937 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →