CVE-2021-21237
mediumpriority · track · 31EPSS 0.005 · 38 %ileEUUSEPSS · scored 2026-10-24
Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator. Other than avoiding untrusted repositories or using a different operating system, there is no workaround. This is fixed in v2.13.2.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 4.6–7.8
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (5)
Products and version ranges known to be affected.
- git large file storage project git large file storage< 2.13.2nvdUScpe:2.3:a:git_large_file_storage_project:git_large_file_storage:*:*:*:*:*:*:*:*
- Go github.com/git-lfs/git-lfs< 1.5.1-0.20210113180018-fc664697ed2cosvUSpkg:golang/github.com/git-lfs/git-lfs
advisories (3)
Vendor and ecosystem advisories describing this.
- GHSA-cx3w-xqmc-84g5Git LFS can execute a Git binary from the current directory on Windows2022-02-15ghsa · osvUS
### Impact On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, [Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator](https://github.com/golang/go/issues/38736). ### Patches This version should be patched in v2.13.2, which will be released in coordination with this security advisory. ### Workarounds Other than avoiding untrusted repositories or using a different operating system, there is no workaround. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: - Start a discussion in [the Git LFS discussion page](https://github.com/git-lfs/git-lfs/discussions). - If you cannot open a discussion, please email the core team using their usernames at `github.com`.
- BIT-git-lfs-2021-21237Git LFS can execute a Git binary from the current directory on Windows2024-03-06vendor · osvUS
Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator. Other than avoiding untrusted repositories or using a different operating system, there is no workaround. This is fixed in v2.13.2.
- GO-2021-0098Arbitrary code execution on Windows in github.com/git-lfs/git-lfs2021-04-14vendor · osvUS
Due to the standard library behavior of exec.LookPath on Windows a number of methods may result in arbitrary code execution when cloning or operating on untrusted Git repositories.
also known as (6)
Other names and identifiers for this entity.
- CNNVD-202101-1302cnnvd
- EUVD-2022-0965enisa_euvd
- GHSA-cx3w-xqmc-84g5enisa_euvd
- BIT-git-lfs-2021-21237osv
- GHSA-cx3w-xqmc-84g5osv
- GO-2021-0098osv
sources
Which sources assert this record, and when.
references (13)
External citations — patches, advisories, analysis.
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-27955cnnvd
- https://github.com/git-lfs/git-lfs/commit/fc664697ed2c2081ee9633010de0a7f9debea72acnnvd
- https://github.com/git-lfs/git-lfs/releases/tag/v2.13.2cnnvd
- https://github.com/git-lfs/git-lfs/security/advisories/GHSA-cx3w-xqmc-84g5cnnvd
- https://nvd.nist.gov/vuln/detail/CVE-2021-21237cnnvd
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-27955enisa_euvd
- https://github.com/git-lfs/git-lfs/commit/fc664697ed2c2081ee9633010de0a7f9debea72aenisa_euvd
- https://github.com/git-lfs/git-lfs/releases/tag/v2.13.2enisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan