# CVE-2026-22701: filelock Time-of-Check-Time-of-Use (TOCTOU) Symlink Vulnerability in SoftFileLock

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.13%, higher than 2% of CVEs (2026-12-01)
- Published: 2026-01-10T05:59:28.872Z
- Modified: 2026-09-10T03:50:33.702Z
- Also known as: GHSA-qmgc-5h2g-mvrw, PYSEC-2026-1374
- Weaknesses: CWE-59, CWE-362, CWE-367
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- tox-dev filelock: < 3.20.3; before 3.20.3
- filelock (PyPI): before 3.20.3

## Every score

- GitHub_M: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H`
- GitHub: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H`
- PyPA Advisory Database: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H`

## References

- <https://github.com/tox-dev/filelock/security/advisories/GHSA-qmgc-5h2g-mvrw> (mitigation, patch, vendor-advisory, web)
- <https://github.com/tox-dev/filelock/commit/255ed068bc85d1ef406e50a135e1459170dd1bf0> (patch, web)
- <https://github.com/tox-dev/filelock/commit/41b42dd2c72aecf7da83dbda5903b8087dddc4d5> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-22701> (advisory)
- <https://github.com/tox-dev/filelock> (package)
- <https://pypi.org/project/filelock> (package)
- <https://github.com/advisories/GHSA-qmgc-5h2g-mvrw> (advisory)

## Sources

- CVE List: [CVE-2026-22701](https://www.cve.org/CVERecord?id=CVE-2026-22701), CVE Terms of Use, modified 2026-01-12
- GitHub Advisory Database: [GHSA-qmgc-5h2g-mvrw](https://github.com/advisories/GHSA-qmgc-5h2g-mvrw), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-22701](https://nvd.nist.gov/vuln/detail/CVE-2026-22701), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1374](https://osv.dev/vulnerability/PYSEC-2026-1374), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2026-22701 · Whole record: https://cve.day/CVE-2026-22701.json · Rebuilt by cve.day 2026-11-25T22:59:12.719Z
