filelock is vulnerable to Link Following
59
CVE Score
Medium
Link Following
ReadWriteLock and AsyncReadWriteLock resolve their SQLite lock-database path with pathlib.Path(lock_file).resolve() and open it with a plain sqlite3.connect() call, both of which follow symbolic links. A user who can create or replace a name inside a shared lock directory plants a symlink at the lock path before the victim constructs the lock, redirecting the victim's lock database to a different file and defeating the mutual-exclusion guarantee, or substitutes a non-regular file such as a FIFO at that path. The fix opens the database through a descriptor obtained with O_NOFOLLOW (or a non-reparse-point handle on Windows), rejects non-regular files, and pins SQLite to that already-validated descriptor.
Upgrade the filelock library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you use ReadWriteLock or AsyncReadWriteLock with a lock file path inside a directory writable by other untrusted local users or processes.
3.20.4 - 4.0.8
Fixed in 4.0.9filelock is vulnerable to Link Following in versions 3.20.4 - 4.0.8.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.