All vulnerabilities

PyPI

CVE-2026-112912

filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker

Severity
Low 2.5
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.2.1
Exploit chance
0.2% in the next 30 daysHigher than 11% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Link following (CWE-59)
Attack
Needs local access · Only under certain conditions · Needs a user account · No user action needed
Attacker can
Read some data
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
Also known as
GHSA-9j6q-wvj5-jgjg
Sources
OSV.dev and GitHub

Description

raise_on_not_writable_file() is the check that SoftFileLock and the locks sharing its acquire path run before every attempt. It looks at the lock path with os.lstat, so that it judges a planted symlink (a file that points at another path) by itself. When the node has no owner-write bit, it then calls os.access(filename, os.W_OK), which follows symlinks. A local user who can create entries in the lock's directory can swap the path between a mode-0466 file and a symlink to a path of their choosing. The second call then reports on the symlink's target with the permissions of the user running the lock (below: the lock user). The lock user's acquire() ends in PermissionError within a fraction of a second when the target is missing or not writable by the lock user, and in the ordinary Timeout otherwise.

That yields one bit per watched acquire. The bit says whether a path exists and is writable by the lock taker.

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

Affected software

SoftwareAffected versions
filelockPyPI · osv:PyPI:filelock
  • From 3.32.6 before 4.2.1

About filelock

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

References