CVE-2026-112909: filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path
UnixFileLock, the backend of FileLock and AsyncFileLock on Unix, empties whatever regular file it finds at the lock path once it holds the flock (a kernel lock on an open file). With an explicit mode it also chmods that file (sets its permission bits), whether or not this acquire created it. Another local user who can rename or hard-link one of the files of the user running the lock (below: the lock user) onto the lock path gets that file truncated by the lock user’s next acquire(). A hard link is a second name for the same file. With a mode such as 0o666 the file, still owned by the lock user, also becomes readable and writable by that other user. The other user can then read and alter everything the lock user writes to it afterwards.
O_NOFOLLOW, the defence added for the symlink variant (CVE-2025-68146), does not see a renamed file or a hard link. The rename route needs the file’s directory to be writable without the sticky bit (a directory flag that lets only a file’s owner remove or rename it). The hard-link route into a sticky directory such as /tmp needs fs.protected_hardlinks=0, a Linux kernel setting. Affected versions are every filelock release up to and including 4.2.0 (the truncation is as old as the project; the chmod since 3.10.2).
Anthropic’s OSS Scanner reported this in private. Finding covered by this advisory:
ANT-2026-KO573NWI[high, CWE-706]: UnixFileLock truncates and chmods victim files renamed onto the lock path.
References
- github.com/advisories/GHSA-69hj-f68j-2879
- github.com/tox-dev/filelock/commit/e1e825b1992f69fb6b346dc395d5ae4893536c0a
- github.com/tox-dev/filelock/pull/835
- github.com/tox-dev/filelock/releases/tag/4.2.1
- github.com/tox-dev/filelock/security/advisories/GHSA-69hj-f68j-2879
- nvd.nist.gov/vuln/detail/CVE-2026-112909
Code Behaviors & Features
Detect and mitigate CVE-2026-112909 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 →