7.2high
Git LFS can execute a Git binary from the current directory on Windows
- Severity
- 7.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.45% (higher than 41% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-cx3w-xqmc-84g5BIT-GIT-LFS-2021-21237GO-2021-0098
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| git-lfs git-lfs | < 2.13.2 | CVE List |
| github.com/git-lfs/git-lfs (Go) | before 2.13.2, before 1.5.1-0.20210113180018-fc664697ed2c | GitHub Advisory Database, Go Vulnerability Database |
| git_large_file_storage_project git_large_file_storage | before 2.13.2 | NVD |
| git-lfs (Bitnami) | before 2.13.2 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 7.2high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N |
| GitHub | 7.2high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 4.6medium CVSS:2.0 | AV:L/AC:L/Au:N/C:P/I:P/A:P |
| Bitnami Vulnerability Database | high rating |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
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.
- If you cannot open a discussion, please email the core team using their usernames at
github.com.
Go Vulnerability Database
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.
NVD (es)
Git LFS es una extensión de línea de comandos para administrar archivos grandes con Git. En Windows, si Git LFS opera en un repositorio malicioso con un archivo git.bat o git.exe en el directorio actual, ese programa será ejecutado, permitiendo al atacante ejecutar código arbitrario. Esto no afecta a los sistemas Unix. Este es el resultado de una corrección incompleta para CVE-2020-27955. Este problema ocurre porque en Windows, Go incluye (y prefiere) el directorio actual cuando el nombre de un comando ejecutado no contiene un separador de directorio. Aparte de evitar los repositorios que no son confiables o usando un sistema operativo diferente, no se presenta una solución alternativa. Esto es corregido en versión v2.13.2
References
| https://github.com/git-lfs/git-lfs/security/advisories/GHSA-cx3w-xqmc-84g5 | advisory, third-party-advisory, web | |
| https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-27955 | advisory, third-party-advisory, web | |
| https://github.com/git-lfs/git-lfs/releases/tag/v2.13.2 | advisory, third-party-advisory, web | |
| https://github.com/git-lfs/git-lfs/commit/fc664697ed2c2081ee9633010de0a7f9debea72a | advisory, fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21237 | advisory, web | |
| https://github.com/git-lfs/git-lfs | package | |
| https://pkg.go.dev/vuln/GO-2021-0098 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21237 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cx3w-xqmc-84g5 changed 2026-07-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2021-0098 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2021-21237 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GIT-LFS-2021-21237 changed 2026-09-08 | Apache-2.0 |