CVE-2026-112936: filelock: ReadWriteLock follows a symlink at the lock path into SQLite

Published Oct 20, 2026
·
Updated

Summary

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.

Details

ReadWriteLock.init stores pathlib.Path(lockfile).resolve(), which follows a final symlink, and every connection opens that path through sqlite3.connect() with no ONOFOLLOW or regular-file check. SQLite's own VFS also resolves the final symlink in user space, so fs.protectedsymlinks 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 ONOFOLLOW, and SoftReadWriteLock coordinates through <path>.rw/.

Proof of concept

On Linux, with the victim and attacker as different users and /shared mode 1777 with fs.protectedsymlinks=1:

1. The attacker runs ln -s /home/victim/private/pwned.flag /shared/app.rwlock.db. 2. The victim constructs ReadWriteLock("/shared/app.rwlock.db"). A plain os.open(..., ONOFOLLOW) on the same path fails, but the lock creates /home/victim/private/pwned.flag, owned by the victim, inside a directory the attacker cannot write. 3. With /shared/cache.rwlock.db -> /shared/a.db, one victim process holds the write lock. The attacker repoints the link to /shared/b.db, and a second victim process acquires the write lock while the first still holds it.

The same behavior reproduces on macOS, on Windows 11, and through AsyncReadWriteLock.

Impact

A local attacker with write access to the lock directory can make the victim create empty files it owns at paths the attacker cannot write, make the victim hold a SQLite lock on another application's database so that application gets database is locked, and give two victim processes the write lock at once, letting them corrupt the resource the lock protects.

Workarounds

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

Other sources

filelock is a platform-independent file lock for Python. From 3.20.4 until 4.0.9, ReadWriteLock and AsyncReadWriteLock versions from 3.20.4 resolve the lock path and pass it to SQLite without rejecting a final symbolic link, allowing another local user who can create names in the lock directory to redirect database creation and locking or split mutual exclusion between targets. This issue is fixed in version 4.0.9.

— Ubuntu

Affected Software

13 affected componentsFixes available
pypi/filelock>=3.20.4<4.0.9
tox-dev Filelock Python>=3.20.4<4.0.9
pip/filelock>=3.20.4<=4.0.8
4.0.9
pip/filelock>=3.20.4<4.0.9
4.0.9
ubuntu/python-filelock*
ubuntu/python-filelock*
ubuntu/python-filelock*
ubuntu/python-filelock*
ubuntu/python-filelock*
ubuntu/python-filelock*
debian/python-filelock<=3.9.0-1+deb12u1, <=3.18.0-1+deb13u1
4.1.1-1
IBM App Connect Operator<=CD: 12.1.0 - 12.21.0 12.0 LTS: 12.0.0 - 12.0.28 13 LTS: 13.0.0 - 13.6.0
IBM App Connect EnterpriseCertified Containers Operands<=CD: 12.0.11.1-r1 - 12.0.12.5-r1, 13.0.1.0-r1 - 13.0.6.2-r1 12.0 LTS: 12.0.12-r1 - 12.0.12-r28 13 LTS: 13.0.7.0-r1 - 13.0.9.0-r1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/filelock to a version that resolves this vulnerability.

    Fixed in 4.0.9
  2. Upgrade

    Upgrade debian/python-filelock to a version that resolves this vulnerability.

    Fixed in 4.1.1-1
  3. Upgrade

    Upgrade filelock to a version that resolves this vulnerability.

    Fixed in 4.0.9
  4. Compensating control

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

Event History

Oct 20, 2026
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
CVE Published
via MITRE·02:34 PM
Data Sourced
via MITRE·02:34 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Oct 28, 2026
Data Sourced
via OSV·08:16 PM
Affected Software
Advisory Published
via GitHub·09:08 PM
Data Sourced
via GitHub·09:08 PM
DescriptionSeverityWeaknessAffected Software
Nov 9, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Exploit Published
via GitHub·11:25 AM

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

Who is exposed to this issue?

Applications using filelock ReadWriteLock or AsyncReadWriteLock on versions 3.20.4 through 4.0.8 are exposed when another local user can create entries in the directory containing the lock path. The issue concerns lock paths that can be replaced with a final symbolic link.

2

What must an attacker be able to do?

An attacker needs local access and the ability to create names in the lock directory. They can use a symbolic link at the lock path to redirect SQLite database creation and locking, potentially splitting mutual exclusion between different targets.

3

Are default filelock locks affected?

The provided information identifies ReadWriteLock and AsyncReadWriteLock specifically. It does not state that other filelock lock types are affected.

4

What should be done if the application cannot be upgraded immediately?

Ensure untrusted local users cannot create or replace names in directories used for ReadWriteLock or AsyncReadWriteLock lock files. Use lock directories whose ownership and permissions prevent symbolic-link creation by other users.

5

How can I determine whether my deployment is affected?

Check whether filelock is version 3.20.4 through 4.0.8 and whether the application uses ReadWriteLock or AsyncReadWriteLock. Also review whether other local users can create entries in the directory containing the configured lock path.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203