{"answers":{"affected":"3 open source packages ship an affected version, including filelock. It affects 1 product.","exploited":"There is no known exploitation of CVE-2025-68146 in the wild and no public exploit code.","fix":"Upgrade filelock to 3.20.1 or later.","what":"CVE-2025-68146 is a medium-severity vulnerability in tox-dev filelock, published on 16 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-68146 and fix it if it is affected.\n\nWhat it is: CVE-2025-68146 is a medium-severity vulnerability in tox-dev filelock, published on 16 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-68146 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- filelock (PyPI): affected all versions; fixed in 3.20.1\n- filelock (PyPI): affected all versions; fixed in 3.20.1\n- filelock (PyPI): affected all versions; fixed in 3.20.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-68146/ (Markdown: https://insights.sbomify.com/CVE-2025-68146/index.md)","id":"CVE-2025-68146","markdown":"https://insights.sbomify.com/CVE-2025-68146/index.md","name":"CVE-2025-68146","record":{"aliases":["AZL-72739","AZL-79232","BELL-CVE-2025-68146","CLEANSTART-2026-PE38920","DEBIAN-CVE-2025-68146","ECHO-d3c5-64d2-c403","GHSA-w853-jp5j-5j7f","MINI-26cm-36mw-fwf4","MINI-2qxc-6647-jh58","MINI-7j94-rcmf-27r7","MINI-9xh9-7mfr-rpf9","MINI-gr58-6cfc-g6c8","MINI-j6gg-363m-c3x3","OESA-2026-3143","PYSEC-2026-1375","ROOT-APP-PYPI-CVE-2025-68146","SUSE-SU-2026:0082-1","UBUNTU-CVE-2025-68146","openSUSE-SU-2026:10010-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python file lock library","requires_auth":"low_privilege","summary":"Local attackers can exploit a TOCTOU race condition to corrupt or truncate arbitrary files via symlink attacks during lock file creation.","user_interaction":"not_required","vuln_class":"race_condition"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"filelock","vendor":"tox-dev"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-59","name":"Improper Link Resolution Before File Access"},{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition"},{"id":"CWE-362","name":"Concurrent Execution using Shared Resource with Improper Synchronization"}],"description":"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.","ecosystems":["PyPI","SUSE:Linux Enterprise Module for Development Tools 15 SP7","SUSE:Linux Enterprise Module for Package Hub 15 SP7","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"filelock has TOCTOU race condition that allows symlink attacks during lock file creation","id":"CVE-2025-68146","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"race_condition","year":"2025"},"n_packages":6,"n_references":4,"next":{"headline":"opensourcepos has a Cross-site Scripting vulnerability","id":"CVE-2025-68147"},"packages":[{"ecosystem":"PyPI","fixed":["3.20.1"],"introduced":["0"],"last_affected":[],"package":"filelock","purl":null,"source":"GHSA-w853-jp5j-5j7f"},{"ecosystem":"PyPI","fixed":["3.20.1"],"introduced":["0"],"last_affected":[],"package":"filelock","purl":"pkg:pypi/filelock","source":"GHSA-w853-jp5j-5j7f"},{"ecosystem":"PyPI","fixed":["3.20.1"],"introduced":["0"],"last_affected":[],"package":"filelock","purl":"pkg:pypi/filelock","source":"PYSEC-2026-1375"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP7","fixed":["3.0.12-150100.3.6.1"],"introduced":["0"],"last_affected":[],"package":"python-filelock","purl":"pkg:rpm/suse/python-filelock\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP7","source":"SUSE-SU-2026:0082-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP7","fixed":["3.0.12-150100.3.6.1"],"introduced":["0"],"last_affected":[],"package":"python-filelock","purl":"pkg:rpm/suse/python-filelock\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP7","source":"SUSE-SU-2026:0082-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["3.20.2-1.1"],"introduced":["0"],"last_affected":[],"package":"python-filelock","purl":"pkg:rpm/opensuse/python-filelock\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:10010-1"}],"prev":{"headline":"mcp-server-git has missing path validation when using --repository flag","id":"CVE-2025-68145"},"products":["filelock"],"published":"2025-12-16","related":[{"cvss_score":7.1,"headline":"filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files","id":"CVE-2026-112940","kev_date_added":null,"published":"2026-10-20"},{"cvss_score":6.3,"headline":"filelock: StrictSoftFileLock and SoftReadWriteLock adopt a protocol directory another user created first, losing mutual exclusion","id":"CVE-2026-112911","kev_date_added":null,"published":"2026-10-20"},{"cvss_score":6.1,"headline":"filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path","id":"CVE-2026-112909","kev_date_added":null,"published":"2026-10-20"},{"cvss_score":6.1,"headline":"filelock: SoftReadWriteLock holder refresh writes through a hard link and hangs on a named pipe that another local user renames over its record","id":"CVE-2026-112934","kev_date_added":null,"published":"2026-10-20"},{"cvss_score":6.1,"headline":"filelock: ReadWriteLock follows a symlink at the lock path into SQLite","id":"CVE-2026-112936","kev_date_added":null,"published":"2026-10-20"},{"cvss_score":6.1,"headline":"filelock: ReadWriteLock on the hard-link route deletes any directory another user renames onto its .filelock-* link directory name","id":"CVE-2026-112937","kev_date_added":null,"published":"2026-10-20"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-12-17","vendors":["tox-dev"]},"summary":"Local attackers can exploit a TOCTOU race condition to corrupt or truncate arbitrary files via symlink attacks during lock file creation.","url":"https://insights.sbomify.com/CVE-2025-68146/"}