CVE-2026-112940
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.1
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
CVE-2026-112940- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Weakness
- CWE-363
- Updated
- 2026-11-02
EUVDEUVD-2026-105031
7.1
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
EUVD-2026-105031- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-v4x8-3wr5-3wq8
7.1
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
ReadWriteLock and AsyncReadWriteLock (the SQLite-backed reader/writer lock) hand SQLite a name they do not control. On Linux the lock validates its database through a descriptor (the number the kernel gives a process for an open file). It then connects SQLite to /proc/self/fd/<n>, a Linux path that names the process's own open file n. SQLite turns that path back into a plain path and reopens it by name, following symlinks (a symlink is a file that points at another path). On every POSIX route SQLite also acts on -journal, -wal and -shm files it finds beside that name. Those are SQLite's side files: the rollback journal (pages saved to undo an interrupted write), the write-ahead log or WAL (changes kept outside the main file), and the shared-memory index for the WAL.
Another local user who can create or rename entries in the directory that holds the lock database can turn this against the user running the lock (below: the lock user). Such a directory is a 0777 or group-writable cache, build or project directory without the sticky bit (a directory flag that lets only a file's owner remove or rename it). That other user can make the lock user's ordinary read_lock() or write_lock() write bytes of the other user's choosing into the lock user's own files. The same position lets the other user make that call create or unlink files of the lock user, admit a reader beside a writer, or kill the holder. All of this runs with the lock user's privileges. In a sticky directory such as /tmp a planted -wal file makes every acquire fail. Affected versions are filelock 3.20.4 through 4.2.0 (the /proc/self/fd redirect since 4.0.9, the side-file variants since 3.20.4).
Anthropic's OSS Scanner reported this in private as ANT-2026-KMJ2575J [high, CWE-363]: ReadWriteLock: SQLite still follows planted symlinks, overwriting files.
Severity
CVSS 3.1 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H scores 7.1 (High). AV:L (local): the other user needs an account on the same host. PR:L (low privileges): an ordinary account is enough. UI:N (no user interaction). AC:L (low attack complexity): the planted-journal variant needs no race, and the redirect won 77 of 77 attempts. I:H (high integrity impact): the other user writes bytes of their choosing into files of the lock user and unlinks files of their choosing. A:H (high availability impact): the other user makes every acquire fail or kills the lock holder. C:N (no confidentiality impact): the other user learns nothing. S:U (scope unchanged): the effect stays within the lock user's own privileges.
Classification from the external review: conditional security, a cross-user effect that exists only when another user can change names in the lock database's directory. The review notes that the 77/77 inotify result (inotify is a Linux interface that reports file events) is stronger evidence than a theoretical TOCTOU (a time-of-check to time-of-use race). The scanner rated it high. The review accepts the mechanism and narrows it to that precondition.
Scope and preconditions
- The other party is a different local account that can create or rename entries in the directory that holds the lock database. That is a
0777directory or a group-writable one (including a setgid2775project directory shared with that account), in each case without the sticky bit. The lock user's lock must be able to open the database read-write, so a database the other user creates is0666. filelock itself creates the database0600. - Sticky directories (
/tmp,/var/tmp, any1777directory) narrow the finding rather than exclude it. The redirect and the journal replay do not reach a database the lock user owns there (tested withfs.protected_regular=2). What remains is a planted non-empty<db>-wal(any mode; a directory or FIFO works too) that the lock user cannot unlink. It makes every acquire raisesqlite3.OperationalError: disk I/O error. A hard link (a…
- Record
GHSA-v4x8-3wr5-3wq8- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Weakness
- CWE-59, CWE-363
- Updated
- 2026-11-02
NVD
7.1
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
CVE-2026-112940- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Weakness
- CWE-363, CWE-59
- Updated
- 2026-11-02
OSV
7.1
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
CVE-2026-112940- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Weakness
- CWE-363
- Updated
- 2026-11-05
OSVDEBIAN-CVE-2026-112940
7.1
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
DEBIAN-CVE-2026-112940- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-v4x8-3wr5-3wq8
7.1
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
ReadWriteLock and AsyncReadWriteLock (the SQLite-backed reader/writer lock) hand SQLite a name they do not control. On Linux the lock validates its database through a descriptor (the number the kernel gives a process for an open file). It then connects SQLite to /proc/self/fd/<n>, a Linux path that names the process's own open file n. SQLite turns that path back into a plain path and reopens it by name, following symlinks (a symlink is a file that points at another path). On every POSIX route SQLite also acts on -journal, -wal and -shm files it finds beside that name. Those are SQLite's side files: the rollback journal (pages saved to undo an interrupted write), the write-ahead log or WAL (changes kept outside the main file), and the shared-memory index for the WAL.
Another local user who can create or rename entries in the directory that holds the lock database can turn this against the user running the lock (below: the lock user). Such a directory is a 0777 or group-writable cache, build or project directory without the sticky bit (a directory flag that lets only a file's owner remove or rename it). That other user can make the lock user's ordinary read_lock() or write_lock() write bytes of the other user's choosing into the lock user's own files. The same position lets the other user make that call create or unlink files of the lock user, admit a reader beside a writer, or kill the holder. All of this runs with the lock user's privileges. In a sticky directory such as /tmp a planted -wal file makes every acquire fail. Affected versions are filelock 3.20.4 through 4.2.0 (the /proc/self/fd redirect since 4.0.9, the side-file variants since 3.20.4).
Anthropic's OSS Scanner reported this in private as ANT-2026-KMJ2575J [high, CWE-363]: ReadWriteLock: SQLite still follows planted symlinks, overwriting files.
Severity
CVSS 3.1 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H scores 7.1 (High). AV:L (local): the other user needs an account on the same host. PR:L (low privileges): an ordinary account is enough. UI:N (no user interaction). AC:L (low attack complexity): the planted-journal variant needs no race, and the redirect won 77 of 77 attempts. I:H (high integrity impact): the other user writes bytes of their choosing into files of the lock user and unlinks files of their choosing. A:H (high availability impact): the other user makes every acquire fail or kills the lock holder. C:N (no confidentiality impact): the other user learns nothing. S:U (scope unchanged): the effect stays within the lock user's own privileges.
Classification from the external review: conditional security, a cross-user effect that exists only when another user can change names in the lock database's directory. The review notes that the 77/77 inotify result (inotify is a Linux interface that reports file events) is stronger evidence than a theoretical TOCTOU (a time-of-check to time-of-use race). The scanner rated it high. The review accepts the mechanism and narrows it to that precondition.
Scope and preconditions
- The other party is a different local account that can create or rename entries in the directory that holds the lock database. That is a
0777directory or a group-writable one (including a setgid2775project directory shared with that account), in each case without the sticky bit. The lock user's lock must be able to open the database read-write, so a database the other user creates is0666. filelock itself creates the database0600. - Sticky directories (
/tmp,/var/tmp, any1777directory) narrow the finding rather than exclude it. The redirect and the journal replay do not reach a database the lock user owns there (tested withfs.protected_regular=2). What remains is a planted non-empty<db>-wal(any mode; a directory or FIFO works too) that the lock user cannot unlink. It makes every acquire raisesqlite3.OperationalError: disk I/O error. A hard link (a…
- Record
GHSA-v4x8-3wr5-3wq8- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Weakness
- CWE-363, CWE-59
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-112940
7.1
filelock is a platform-independent file lock for Python. From 3.20.4 until 4.2.1, ReadWriteLock let SQLite reopen the database and side files by name; on POSIX systems an attacker with rename access in a non-sticky parent can swap those names to cause overwrite or unlink operations, while a writable adjacent hot journal is additionally required for attacker-chosen content overwrites. This issue is fixed in version 4.2.1.
- Record
UBUNTU-CVE-2026-112940- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2026-112940 No score
CVE-2026-112940 in filelock - Patched by Root
Root has patched CVE-2026-112940 in the filelock package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-112940- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
filelockPyPI |
3.20.4 to 4.2.0 | 4.2.1 |
python-filelockDebian:12 |
All versions, plus listed versions 3.12.2-13.12.3-13.12.4-13.13.1-13.13.3-1 Show 29 moreShow less3.13.4-13.14.0-13.15.4-13.16.1-13.16.1-23.17.0-13.18.0-13.19.1-13.20.0-13.20.2-13.20.3-13.24.3-13.25.0-13.25.2-13.29.0-13.29.4-13.29.5-13.29.7-13.32.0-13.32.2-13.32.4-13.32.4-23.32.5-13.32.6-13.9.0-13.9.0-1+deb12u14.0.1-14.0.12-14.1.1-1 |
None known |
python-filelockDebian:13 |
All versions, plus listed versions 3.18.0-13.18.0-1+deb13u13.19.1-13.20.0-13.20.2-1 Show 17 moreShow less3.20.3-13.24.3-13.25.0-13.25.2-13.29.0-13.29.4-13.29.5-13.29.7-13.32.0-13.32.2-13.32.4-13.32.4-23.32.5-13.32.6-14.0.1-14.0.12-14.1.1-1 |
None known |
python-filelockDebian:14 |
All versions, plus listed versions 3.18.0-13.19.1-13.20.0-13.20.2-13.20.3-1 Show 16 moreShow less3.24.3-13.25.0-13.25.2-13.29.0-13.29.4-13.29.5-13.29.7-13.32.0-13.32.2-13.32.4-13.32.4-23.32.5-13.32.6-14.0.1-14.0.12-14.1.1-1 |
None known |
filelockPyPI |
3.20.4 up to 4.2.1, plus listed versions 3.21.03.21.13.21.23.22.03.23.0 Show 45 moreShow less3.24.03.24.13.24.23.24.33.25.03.25.13.25.23.28.03.29.03.29.13.29.23.29.33.29.43.29.53.29.63.29.73.30.03.30.13.30.23.30.33.31.03.31.13.31.23.32.03.32.23.32.33.32.43.32.53.32.63.32.74.0.04.0.14.0.104.0.114.0.124.0.24.0.34.0.44.0.54.0.64.0.74.0.84.0.94.1.04.1.1 |
4.2.1 |
filelockRoot:PyPI |
before 3.32.3+aikido.1 | 3.32.3+aikido.13.29.7+aikido.13.29.3+aikido.13.32.2+aikido.14.0.12+aikido.13.29.0+aikido.13.32.6+aikido.14.1.1+aikido.14.0.9+aikido.13.32.4+aikido.13.32.7+aikido.13.32.5+aikido.1 |
python-filelockUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 2.0.11-12.0.12-12.0.13-13.0.0-23.0.3-13.0.4-13.0.4-1ubuntu0.1~esm1 |
None known |
python-filelockUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 3.0.12-13.0.12-23.0.12-2ubuntu0.1~esm1 |
None known |
python-filelockUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 3.0.12-23.3.2-13.4.0-13.4.2-13.4.2-23.6.0-13.6.0-1ubuntu0.1~esm1 |
None known |
python-filelockUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 3.12.2-13.12.4-13.13.1-13.13.1-1ubuntu0.1~esm1 |
None known |
python-filelockUbuntu:26.10 |
All versions, plus listed versions 3.20.3-13.29.4-13.32.0-13.32.2-1 |
None known |
python-filelockUbuntu:26.04:LTS |
All versions, plus listed versions 3.18.0-13.20.0-13.20.2-13.20.3-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-112940 is a high vulnerability (CVSS 7.1) in Tox-dev Filelock, published October 20, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.19%, the 8th percentile. Fixed in filelock 4.2.1.
References
github.com/tox-dev/filelock/security/advisories/GHSA-v4x8-3wr5-3wq8
github.com/tox-dev/filelock/pull/834
github.com/tox-dev/filelock/commit/5e3f2ec0c5fb17cb2635b60b2b68bc63ab81ca2d
github.com/tox-dev/filelock/releases/tag/4.2.1
nvd.nist.gov/vuln/detail/CVE-2026-112940
github.com/advisories/GHSA-v4x8-3wr5-3wq8
Left out here: 2 versions and the rest of 2 source descriptions. The JSON record has them.