ADVISORIES

Vulnerability

CVE-2025-68146

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.

82 advisories report this vulnerability, across 10 ecosystems.

Advisories

  • ALAS2023-2026-1411

    Amazon Linux 2023 - ALAS2023-2026-1411: Medium priority package update for python3.13-filelock

    Medium CVE-2025-68146CVE-2026-22701 Amazon Linux Updated 18 February 2026
  • ALAS2023-2026-1415

    Amazon Linux 2023 - ALAS2023-2026-1415: Medium priority package update for python-filelock

    Medium CVE-2025-68146CVE-2026-22701 Amazon Linux Updated 5 February 2026
  • AZL-72739

    CVE-2025-68146 affecting package python-filelock for versions less than 3.20.1-1

    CVE-2025-68146 Azure Linux Updated 21 April 2026
  • AZL-79232

    CVE-2025-68146 affecting package python-filelock 3.0.12-13

    CVE-2025-68146 Azure Linux Updated 21 April 2026
  • CGA-25mv-mrpw-hhjx
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-278w-f7jq-78rg
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-2hp2-6hq9-xjm5
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-3c5p-4gfm-4r72
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-3gv3-fqqh-9h5h
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-3rjq-vgwg-4qh8
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-3vg7-r79f-c6vc
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-59c9-rrvv-m522
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-59pm-8pxj-grwh
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-5c6c-9cmw-pgx2
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-5h32-2x32-g4f4
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-5jhc-gg98-59pq
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-6q82-j9hm-g529
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-6w65-gc6j-836j
    CVE-2025-68146 Chainguard Updated 11 September 2026
  • CGA-74px-m7mf-3788
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-84g6-h638-fp59
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-85w4-rqj4-52rh
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-8cm7-cw65-mmv5
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-8m6r-mg3x-9jvv
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-8mxf-5h82-gmq4
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-8p52-2mcq-64vc
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-9474-j7g3-56hx
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-96pf-4qgx-7cm6
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-98r7-ww3v-fp9f
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-98xc-wp46-8xv9
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-9mj3-c589-4v35
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-c287-x95g-2w77
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-cfc4-hv5p-hmvq
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-ch64-h84r-hvf5
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-cwqr-7jq9-6r8x
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-f7r8-jj44-v7jv
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-fcw8-pwjx-p39r
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-ff6p-34w6-rvf6
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-g5wp-vvgx-pwhc
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-g6r2-pfhh-99g6
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-g9vw-5vxf-698x
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-h5mx-fjw3-7fm5
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-hc82-ch33-89g5
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-hj4m-v7hw-cx63
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-hxvj-j7r6-wxv6
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-j4rp-rjc4-rfgh
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-jrjj-6g6v-c4vp
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-m22m-6jw7-w6cr
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-m6cf-7wqm-3xfm
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-mpxp-2whw-w2h8
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-mqj9-m856-h5qr
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-pp5f-vjjp-443x
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-pv3q-ch35-vm5f
    CVE-2025-68146 Chainguard Updated 11 September 2026
  • CGA-q6w2-836c-449j
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-q89v-qjcw-fhfx
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-qf8j-g9mg-jwp8
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-qvv9-hcqh-4qgq
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-r476-rwrf-9f9w
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-r7r4-rmhg-chh4
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-r8fw-rhw2-hfcq
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-r8wv-f9jw-g69p
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-r946-chw9-4cff
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-rqrv-mrpm-cm7c
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-v3fw-hcp8-vm9q
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-v5pv-7x22-4hg3
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-v9j6-76q9-6mm8
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-vjmj-9h37-mjmw
    CVE-2025-68146 ChainguardWolfi Updated 5 November 2026
  • CGA-x93f-qqr6-xv3g
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • CGA-xx96-f2r8-w68p
    CVE-2025-68146 Chainguard Updated 5 November 2026
  • DEBIAN-CVE-2025-68146

    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…

    CVE-2025-68146 Debian Updated 1 September 2026
  • GHSA-w853-jp5j-5j7f

    filelock has a TOCTOU race condition which allows symlink attacks during lock file creation

    Moderate CVE-2025-68146 PyPI Updated 10 September 2026
  • OESA-2026-3143

    python-filelock security update

    Medium CVE-2025-68146 openEuler Updated 18 August 2026
  • PYSEC-2026-1375

    filelock has a TOCTOU race condition which allows symlink attacks during lock file creation

    CVE-2025-68146 PyPI Updated 7 July 2026
  • SUSE-SU-2026:0082-1

    Security update for python-filelock

    CVE-2025-68146 SUSE Updated 23 March 2026
  • SUSE-SU-2026:0220-1

    Security update for python-filelock

    CVE-2025-68146CVE-2026-22701 SUSEopenSUSE Updated 23 March 2026
  • SUSE-SU-2026:20216-1

    Security update for python-filelock

    CVE-2025-68146CVE-2026-22701 SUSE Updated 23 March 2026
  • SUSEVEX-CVE-2025-68146

    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…

    Moderate CVE-2025-68146 SUSE Updated 10 November 2026
  • UBUNTU-CVE-2025-68146

    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…

    CVE-2025-68146 Ubuntu Updated 9 November 2026
  • USN-7999-1

    python-filelock vulnerabilities

    CVE-2025-68146CVE-2026-22701 Ubuntu Updated 27 April 2026
  • openSUSE-SU-2026:10010-1

    python311-filelock-3.20.2-1.1 on GA media

    CVE-2025-68146 openSUSE Updated 23 March 2026
  • openSUSE-SU-2026:10055-1

    python311-virtualenv-20.36.1-1.1 on GA media

    CVE-2025-68146CVE-2026-22702 openSUSE Updated 23 March 2026
  • openSUSE-SU-2026:12481-1

    ansible-lint-26.11.0-2.1 on GA media

    CVE-2025-68146 openSUSE Updated 9 November 2026
  • openSUSE-SU-2026:20144-1

    Security update for python-filelock

    CVE-2025-68146CVE-2026-22701 openSUSE Updated 23 March 2026

References