CVE-2026-112941: filelock: SoftReadWriteLock follows a lock tree swapped in after its first acquire and writes lock records into directories of the user running the lock
SoftReadWriteLock (and AsyncSoftReadWriteLock, which wraps one) checks once per lock object, by name, that <path>.rw, <path>.rw/gen and <path>.rw/holders are real directories and not symbolic links (files that redirect to another path). It then keeps only a boolean. Every later record operation resolves the full path again, and O_NOFOLLOW (a flag that makes an open fail when the final name is a symbolic link) protects the last component only. Another local user (the other user below) who can write the directory holding the lock, or who created <path>.rw first in a sticky directory such as /tmp (the sticky bit is a directory flag that lets only a file’s owner rename or remove it), can put a tree under that name whose gen or holders is a symbolic link into a directory of the user running the lock (the lock user below).
A long-running process of the lock user that has already passed the check then creates, renames over and deletes files there with the lock user’s privileges, including in 0700 directories the other user cannot open. The names and bytes are filelock’s own lock records, not chosen by the other user. The scanner’s reproducer replaces .git/HEAD in the lock user’s private repository so that git status fails. There is no race. Affected versions: filelock >= 4.1.0 and <= 4.2.0. Anthropic’s OSS Scanner reported it in private as ANT-2026-WXXRI4M4 [high, CWE-367], titled “SoftReadWriteLock follows gen dir swapped for a symlink after first acquire”.
References
- github.com/advisories/GHSA-wfhq-q4j2-c37m
- github.com/tox-dev/filelock/commit/bfa066d65a1ba9106f86ee9d027f7588b9c77e03
- github.com/tox-dev/filelock/pull/842
- github.com/tox-dev/filelock/releases/tag/4.2.1
- github.com/tox-dev/filelock/security/advisories/GHSA-wfhq-q4j2-c37m
- nvd.nist.gov/vuln/detail/CVE-2026-112941
Code Behaviors & Features
Detect and mitigate CVE-2026-112941 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 →