All vulnerabilities

PyPI

CVE-2026-112936

filelock: ReadWriteLock follows a symlink at the lock path into SQLite

Severity
Medium 6.1
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.0.9
Exploit chance
0.2% in the next 30 daysHigher than 14% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Link following (CWE-59)Exposure of a resource to the wrong sphere (CWE-668)
Attack
Needs local access · Needs a user account · No user action needed
Attacker can
Change data · Slow it down
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Also known as
GHSA-j8f7-rjxc-mr56
Sources
OSV.dev and GitHub

Description

ReadWriteLock and AsyncReadWriteLock resolve the lock path with pathlib.Path.resolve() and pass it to sqlite3.connect() without refusing a symlink. A local user who can create names in the lock's directory, such as /tmp or a shared cache, can plant a symlink at the lock path and make the victim's process create, lock, or write the file it points to, or break mutual exclusion between the victim's own processes.

ReadWriteLock.init stores pathlib.Path(lock_file).resolve(), which follows a final symlink, and every connection opens that path through sqlite3.connect() with no O_NOFOLLOW or regular-file check. SQLite's own VFS also resolves the final symlink in user space, so fs.protected_symlinks and the sticky bit do not help: the kernel never sees a symlink to refuse. The other lock classes do not follow a final symlink: FileLock opens with O_NOFOLLOW, and SoftReadWriteLock coordinates through .rw/.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Keep ReadWriteLock paths in directories that only trusted users can write.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
filelockPyPI · osv:PyPI:filelock
  • From 3.20.4 before 4.0.9

About filelock

Weekly downloads (PyPI)
151,687,068PyPI Stats, 23 Nov 2026

References