# CVE-2025-68146: filelock has TOCTOU race condition that allows symlink attacks during lock file creation

- Priority: **Routine**
- Reason: Not severe (CVSS 6.3, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-12-16 · Modified: 2025-12-17
- Aliases: SUSE-SU-2026:0082-1, GHSA-w853-jp5j-5j7f, PYSEC-2026-1375, UBUNTU-CVE-2025-68146, DEBIAN-CVE-2025-68146, CGA-25mv-mrpw-hhjx, CGA-278w-f7jq-78rg, CGA-2hp2-6hq9-xjm5, CGA-3rjq-vgwg-4qh8, CGA-3vg7-r79f-c6vc, CGA-59c9-rrvv-m522, CGA-59pm-8pxj-grwh, CGA-5c6c-9cmw-pgx2, CGA-5h32-2x32-g4f4, CGA-5jhc-gg98-59pq, CGA-6q82-j9hm-g529, CGA-74px-m7mf-3788, CGA-84g6-h638-fp59, CGA-85w4-rqj4-52rh, CGA-8cm7-cw65-mmv5, CGA-8m6r-mg3x-9jvv, CGA-8mxf-5h82-gmq4, CGA-8p52-2mcq-64vc, CGA-9474-j7g3-56hx, CGA-96pf-4qgx-7cm6, CGA-98r7-ww3v-fp9f, CGA-9mj3-c589-4v35, CGA-c287-x95g-2w77, CGA-cwqr-7jq9-6r8x, CGA-fcw8-pwjx-p39r, CGA-ff6p-34w6-rvf6, CGA-g5wp-vvgx-pwhc, CGA-g6r2-pfhh-99g6, CGA-g9vw-5vxf-698x, CGA-j4rp-rjc4-rfgh, CGA-m6cf-7wqm-3xfm, CGA-mqj9-m856-h5qr, CGA-pp5f-vjjp-443x, CGA-qf8j-g9mg-jwp8, CGA-qvv9-hcqh-4qgq, CGA-r7r4-rmhg-chh4, CGA-rqrv-mrpm-cm7c, CGA-v3fw-hcp8-vm9q, CGA-v9j6-76q9-6mm8, CGA-vjmj-9h37-mjmw, CGA-x93f-qqr6-xv3g, CGA-xx96-f2r8-w68p, openSUSE-SU-2026:10010-1, CGA-3c5p-4gfm-4r72, CGA-3gv3-fqqh-9h5h, CGA-6w65-gc6j-836j, CGA-98xc-wp46-8xv9, CGA-cfc4-hv5p-hmvq, CGA-ch64-h84r-hvf5, CGA-f7r8-jj44-v7jv, CGA-h5mx-fjw3-7fm5, CGA-hc82-ch33-89g5, CGA-hj4m-v7hw-cx63, CGA-hxvj-j7r6-wxv6, CGA-jrjj-6g6v-c4vp, CGA-m22m-6jw7-w6cr, CGA-mpxp-2whw-w2h8, CGA-pv3q-ch35-vm5f, CGA-q6w2-836c-449j, CGA-q89v-qjcw-fhfx, CGA-r476-rwrf-9f9w, CGA-r8fw-rhw2-hfcq, CGA-r8wv-f9jw-g69p, CGA-r946-chw9-4cff, CGA-v5pv-7x22-4hg3, openSUSE-SU-2026:12481-1
- Record: https://cvemate.com/vulnerability/CVE-2025-68146 · JSON: https://cvemate.com/vulnerability/CVE-2025-68146/json

## Description

```text
filelock is a platform-independent file lock for Python. In versions prior to 3.20.1, a Time-of-Check-Time-of-Use (TOCTOU) race condition allows local attackers to corrupt or truncate arbitrary user files through symlink attacks. The vulnerability exists in both Unix and Windows lock file creation where filelock checks if a file exists before opening it with O_TRUNC. An attacker can create a symlink pointing to a victim file in the time gap between the check and open, causing os.open() to follow the symlink and truncate the target file. All users of filelock on Unix, Linux, macOS, and Windows systems are impacted. The vulnerability cascades to dependent libraries. The attack requires local filesystem access and ability to create symlinks (standard user permissions on Unix; Developer Mode on Windows 10+). Exploitation succeeds within 1-3 attempts when lock file paths are predictable. The issue is fixed in version 3.20.1. If immediate upgrade is not possible, use SoftFileLock instead of UnixFileLock/WindowsFileLock (note: different locking semantics, may not be suitable for all use cases); ensure lock file directories have restrictive permissions (chmod 0700) to prevent untrusted users from creating symlinks; and/or monitor lock file directories for suspicious symlinks before running trusted applications. These workarounds provide only partial mitigation. The race condition remains exploitable. Upgrading to version 3.20.1 is strongly recommended.
```

## Signals

- CVSS: 6.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
- EPSS: 0.204%, percentile 10.901%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected (first 20 of 65)

- chainguard airflow-2 (Chainguard): \< 2.11.0-r17
- chainguard airflow-2-bitnami-compat (Chainguard): \< 2.11.0-r17
- chainguard airflow-2-compat (Chainguard): \< 2.11.0-r17
- chainguard airflow-2-iamguarded-compat (Chainguard): \< 2.11.0-r17
- chainguard airflow-3 (Chainguard): \< 3.1.5-r0
- chainguard airflow-3-bitnami-compat (Chainguard): \< 3.1.5-r0
- chainguard airflow-3-compat (Chainguard): \< 3.1.5-r0
- chainguard airflow-3-iamguarded-compat (Chainguard): \< 3.1.5-r0
- chainguard awx (Chainguard): \< 24.6.1-r21
- chainguard datadog-agent-7.71-core-integrations (Chainguard): All versions (No fix recorded)
- chainguard datadog-agent-7.72-core-integrations (Chainguard): All versions (No fix recorded)
- chainguard datadog-agent-fips-7.71-core-integrations (Chainguard): All versions (No fix recorded)
- chainguard datadog-agent-fips-7.72-core-integrations (Chainguard): All versions (No fix recorded)
- chainguard kserve (Chainguard): \< 0.16.0-r6
- chainguard kserve-agent (Chainguard): \< 0.16.0-r6
- chainguard kserve-agent-compat (Chainguard): \< 0.16.0-r6
- chainguard kserve-huggingfaceserver-cuda-13.3 (Chainguard): All versions (No fix recorded) \| \< 0.21.0-r4
- chainguard kserve-manager (Chainguard): \< 0.16.0-r6
- chainguard kserve-manager-compat (Chainguard): \< 0.16.0-r6
- chainguard kserve-qpext (Chainguard): \< 0.16.0-r6

## References

- <https://github.com/tox-dev/filelock/security/advisories/GHSA-w853-jp5j-5j7f>
- <https://github.com/tox-dev/filelock/pull/461>
- <https://github.com/tox-dev/filelock/commit/4724d7f8c3393ec1f048c93933e6e3e6ec321f0e>
- <https://github.com/tox-dev/filelock/releases/tag/3.20.1>
- <https://www.suse.com/support/update/announcement/2026/suse-su-20260082-1/>
- <https://bugzilla.suse.com/1255244>
- <https://www.suse.com/security/cve/CVE-2025-68146>
- <https://github.com/tox-dev/filelock>
- <https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants>
- <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html>
- <https://pypi.org/project/filelock>
- <https://github.com/advisories/GHSA-w853-jp5j-5j7f>
- <https://nvd.nist.gov/vuln/detail/CVE-2025-68146>
- <https://ubuntu.com/security/CVE-2025-68146>
- <https://www.cve.org/CVERecord?id=CVE-2025-68146>
- <https://ubuntu.com/security/notices/USN-7999-1>
- <https://security-tracker.debian.org/tracker/CVE-2025-68146>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68146.json>

---

Data as of 2026-12-05T18:17:31.346Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
