Description
filelock is a platform-independent file lock for Python. Prior to version 3.20.3, a TOCTOU race condition vulnerability exists in the SoftFileLock implementation of the filelock package. An attacker with local filesystem access and permission to create symlinks can exploit a race condition between the permission validation and file creation to cause lock operations to fail or behave unexpectedly. The vulnerability occurs in the _acquire() method between raise_on_not_writable_file() (permission check) and os.open() (file creation). During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service. This issue has been patched in version 3.20.3.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| tox-dev | filelock | < 3.20.3 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-filelock | 3.20.3-1 | — |
| Debian 13 | python-filelock | No fix yet | — |
| Debian 12 | python-filelock | 3.9.0-1+deb12u1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-filelock | No fix yet | — |
| Ubuntu 25.10 | python-filelock | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | python-filelock | 3.13.1-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu Pro 22.04 LTS | python-filelock | 3.6.0-1ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu Pro 20.04 LTS | python-filelock | 3.0.12-2ubuntu0.1~esm1 | USN-7999-1 |
| Ubuntu Pro 18.04 LTS | python-filelock | 3.0.4-1ubuntu0.1~esm1 | USN-7999-1 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | python-filelock | 3.0.12-150100.3.9.1 | SUSE-SU-2026:0335-1 |
| SLES 3 | python-filelock | 3.12.2-150400.10.8.1 | SUSE-SU-2026:0220-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | python-filelock | 3.18.0-160000.3.1 | SUSE-SU-2026:20216-1 |
| SLES 16.0 | python-filelock | 3.18.0-160000.3.1 | SUSE-SU-2026:20216-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-filelock | 3.20.3-1.1 | openSUSE-SU-2026:10043-1 |
| openSUSE Leap 16.0 | python-filelock | 3.18.0-160000.3.1 | openSUSE-SU-2026:20144-1 |
| openSUSE Leap 15.6 | python-filelock | 3.12.2-150400.10.8.1 | SUSE-SU-2026:0220-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | python3-filelock +1 | 3.3.1-1.amzn2023.0.2 | ALAS2023-2026-1415 |
| Amazon Linux 2023 | python3.13-filelock | 3.18.0-1.amzn2023.0.1 | ALAS2023-2026-1411 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-filelock | 3.20.3-1 | — |
| Azure Linux 2 (CBL-Mariner) | python-filelock | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | airflow-3 | 3.1.5-r4 | — |
| Wolfi rolling | datadog-agent-7.72-core-integrations | No fix yet | — |
| Wolfi rolling | datadog-agent-7.73-core-integrations | 7.73.3-r23 | — |
| Wolfi rolling | py3-cassandra-medusa | 0.27.0-r1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | filelock | < 3.20.3 | 3.20.3 | GHSA-qmgc-5h2g-mvrw |
Advisories 8
- USN-7999-1 python-filelock vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- openSUSE-SU-2026:20144-1 Security update for python-filelock SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2026:10043-1 python311-filelock-3.20.3-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20216-1 Security update for python-filelock SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:0335-1 Security update for python-filelock SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:0220-1 Security update for python-filelock SUSE / openSUSE Security Updates · Mar 23, 2026
- ALAS2023-2026-1411 Moderate: python3.13-filelock security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Feb 18, 2026
- ALAS2023-2026-1415 Moderate: python-filelock security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Feb 5, 2026