All vulnerabilities

PyPI

CVE-2026-112909

filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path

Severity
Medium 6.1
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 12% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-706
Attack
Needs local access · Needs a user account · No user action needed
Attacker can
Read some data · Change data
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N
Also known as
GHSA-69hj-f68j-2879
Sources
OSV.dev and GitHub

Description

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…

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

Affected software

SoftwareAffected versions
filelockPyPI · osv:PyPI:filelock
  • Every version before 4.2.1

About filelock

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

References