github.com/git-lfs/git-lfs
Affected
- introduced
0.5.2, fixed3.7.1(semver)
Fixed versions
3.7.1
Fix
- Fixed version
3.7.1go get github.com/git-lfs/[email protected]
Advisory
Also known as: BIT-git-lfs-2025-26625, CVE-2025-26625, GO-2025-4038
Git LFS may write to arbitrary files via crafted symlinks
Impact
When populating a Git repository's working tree with the contents of Git LFS objects, certain Git LFS commands may write to files visible outside the current Git working tree if symbolic or hard links exist which collide with the paths of files tracked by Git LFS.
Git LFS has resolved this problem by revising the git lfs checkout and git lfs pull commands so that they check for symbolic links in the same manner as performed by Git before writing to files in the working tree. These commands now also remove existing files in the working tree before writing new files in their place.
As well, Git LFS has resolved a problem whereby the git lfs checkout and git lfs pull commands, when run in a bare repository, could write to files visible outside the repository. While a specific and relatively unlikely set of conditions were required for this to occur, it is no longer possible under any circumstances.
Patches
This problem exists in all versions since 0.5.2 and is patched in v3.7.1. All users should upgrade to v3.7.1.
Workarounds
Support for symlinks in Git may be disabled by setting the core.symlinks configuration option to false, after which further clones and fetches will not create symbolic links. However, any symbolic or hard links in existing repositories will still provide the opportunity for Git LFS to write to their targets.
References
For more information
If there are any questions or comments about this advisory:
High Basis: The source's own band: HIGH
0.5.2, fixed 3.7.1 (semver)3.7.1
3.7.1go get github.com/git-lfs/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0